Per ikegami, in comment thread:
The reason a ? is being shown is an encoding issue, not because you actually have a ?. So the first things to do is find out what you actually have. So again I ask, what's the output of use Data::Dumper; { local $Data::Dumper::Useqq = 1; print(Dumper($name)); }.
I get '\240' for the ? chars. Tried again using 'quotemeta "\240";' and that fixes the problem!
240 octal is A0 hex, which is the NBSP, not a question. That's why removing ? didn't help. s/\xA0/ /g would help, but better yet, let's encode the string correctly for your terminal instead.
use open ':std', ':encoding(UTF-8)';