How to print the byte representation of a wchar_t string with non -ASCII chars?

From: Tay, William (William.Tay@usa.xerox.com)
Date: Wed Oct 31 2001 - 10:37:39 EST


Hi,
 
For debugging purpose, I'd like to find out how I can print the byte
representation of a wchar_t string.
 
Say in C, I have wchar_t wstr[10] = L"fran";
Is there any printf or wchar equivalent function (using appropriate format
template) that prints out the string as
66 72 C3 A1 6E in en_US.UTF-8 locale under UNIX?

Like for an ASCII char, I can do printf("%x", toasii('a')); to get 61 (the
byte rep of 'a');
 
Would appreciate your help.

Will



This archive was generated by hypermail 2.1.2 : Wed Oct 31 2001 - 11:49:14 EST