Dependencies:   mbed

Committer:
simon
Date:
Wed Oct 14 22:25:05 2009 +0000
Revision:
0:82feecebc07b

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon 0:82feecebc07b 1 // some examples for printing UTF-8 characters, sford
simon 0:82feecebc07b 2 // - worked on Mac "screen" and PC "putty", but not PC "teraterm"
simon 0:82feecebc07b 3
simon 0:82feecebc07b 4 #include "mbed.h"
simon 0:82feecebc07b 5
simon 0:82feecebc07b 6 #pragma import(__use_utf8_ctype)
simon 0:82feecebc07b 7 #include <wchar.h>
simon 0:82feecebc07b 8
simon 0:82feecebc07b 9 int main() {
simon 0:82feecebc07b 10 printf("How to print UTF-8 chinese characters...\n");
simon 0:82feecebc07b 11
simon 0:82feecebc07b 12 printf("Like this: %lc%lc%lc%lc%lc%lc\n",0x4f60, 0x597d, 0x4f60, 0x597d, 0x4f60, 0x597d);
simon 0:82feecebc07b 13
simon 0:82feecebc07b 14 wprintf(L"Or like this: \u4f60\u597d\u4f60\u597d\u4f60\u597d\n");
simon 0:82feecebc07b 15 }