Dependencies:   mbed

main.cpp

Committer:
simon
Date:
2009-10-14
Revision:
0:82feecebc07b

File content as of revision 0:82feecebc07b:

// some examples for printing UTF-8 characters, sford
// - worked on Mac "screen" and PC "putty", but not PC "teraterm"

#include "mbed.h"

#pragma import(__use_utf8_ctype)
#include <wchar.h>

int main() {
    printf("How to print UTF-8 chinese characters...\n");

    printf("Like this: %lc%lc%lc%lc%lc%lc\n",0x4f60, 0x597d, 0x4f60, 0x597d, 0x4f60, 0x597d);

    wprintf(L"Or like this: \u4f60\u597d\u4f60\u597d\u4f60\u597d\n");
}