Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 // some examples for printing UTF-8 characters, sford
00002 // - worked on Mac "screen" and PC "putty", but not PC "teraterm"
00003 
00004 #include "mbed.h"
00005 
00006 #pragma import(__use_utf8_ctype)
00007 #include <wchar.h>
00008 
00009 int main() {
00010     printf("How to print UTF-8 chinese characters...\n");
00011 
00012     printf("Like this: %lc%lc%lc%lc%lc%lc\n",0x4f60, 0x597d, 0x4f60, 0x597d, 0x4f60, 0x597d);
00013 
00014     wprintf(L"Or like this: \u4f60\u597d\u4f60\u597d\u4f60\u597d\n");
00015 }