This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Displaying Unicode


> From: bstell@ix.netcom.com
> Date: Sat, 11 Nov 2000 10:50:30 -0800
> 
> Here is a UCS-2 display routine I use:
> ==============================================
> void
> dump_UCharString(const UChar *uChar_str)
> {
>   while (*uChar_str) {
>     if (*uChar_str < 0x7F) {
>       printf("%c", *uChar_str);
>     }
>     else {
>       printf("\\x%02x%02x ", (*uChar_str)>>8, (*uChar_str)&0xFF);
>     }
>     uChar_str++;
>   }
> }

If all you need is to display something like "U+1234" for a UTF-8
encoding, then it should be easy to make this happen, either in GDB or
by calling a function from your program.

I thought you wanted something much more sophisticated (since text
which looks like "U+1234 U+4321 U+5789" etc. is all not easy to read).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]