Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@0:82feecebc07b, 2009-10-14 (annotated)
- Committer:
- simon
- Date:
- Wed Oct 14 22:25:05 2009 +0000
- Revision:
- 0:82feecebc07b
Who changed what in which revision?
| User | Revision | Line number | New 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 | } |