real_nan presumes that its string argument is in the host character set,
so __builtin_nan does not work in the presence of -fexec-charset
making the target character set incompatible with the host character set.
It should allow for the argument being in the target character set.
(Other approaches such as special parsing so as not to translate the
string argument to the target character set do not work since this
function should also be used for a plain "nan" built-in function,