Doesn't work:
$ cd "$(mktemp --directory)"
$ touch $'foo\'\n\'bar'
$ ls --quoting-style=shell-escape-always | while read -r escaped; do
> eval "filename=$escaped"
> echo "'$filename'"
> done
'foo'
'bar'
There's no way to tell that that's one file rather than two. Seriously, parsing ls output reliably isn't possible. I've seen exactly one example of a legitimate ls in a script (just this week, for the first time in many years using Bash), and all that did was to check something like whether a directory was empty.