[RFC] Adjust output for strings in tree-pretty-print.c
Paolo Bonzini
bonzini@gnu.org
Mon May 19 15:39:00 GMT 2008
FX wrote:
>> I think the best thing to do is to have a langhook then.
>
> It seems a bit weird to have a langhook for a one-character
> difference, but if there's a consensus on it, I'll go along.
To me too, but I still maintain that it's better to print in UTF-8
(which would make the langhook more useful). The recent Unicode patches
for C possibly could use the langhook too.
>> Endianness issues may also appear. Maybe you should call iconv in the
>> langhook to get back to UTF-8, and print that representation instead.
>
> Endianness is already take care of, in the sense that the string is
> encoded in the target's endianness already.
But for testing you want a standardized endianness. Otherwise some
targets will need to scan "I\0\0\0" and others will need to scan "\0\0\0I".
> However, that makes
> calling iconv more difficult, because that has us going from target's
> endianness to UTF-8, which will be a pain.
No, you can use UTF-32BE and UTF-32LE encodings.
Paolo
More information about the Gcc-patches
mailing list