Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- int main() {
- std::string al[] {
- // Using unicode escapes:
- " \u00e1", // á - U+00E1 - LATIN SMALL LETTER A ACUTE - UTF-8: 0xC3 0xA1
- " \u00e9", // é - U+00E9 - LATIN SMALL LETTER E WITH ACUTE - UTF-8: 0xC3 0xA9
- " \u0151", // ő - U+0151 - LATIN SMALL LETTER O WITH DOUBLE ACUTE - UTF-8: 0xC5 0x91
- " \u0171", // ű - U+0171 - LATIN SMALL LETTER U WITH DOUBLE ACUTE - UTF-8: 0xC5 0xB1
- "\n",
- // Using UTF-8 code directly
- " \xc3\xa1", // UTF-8: 0xC3 0xA1
- " \xc3\xa9", // UTF-8: 0xC3 0xA9
- " \xc5\x91", // UTF-8: 0xC5 0x91
- " \xc5\xb1", // UTF-8: 0xC5 0xB1
- };
- for (auto u8 : al) {
- std::cout << u8;
- }
- std::cout << std::endl;
- return 0;
- }
- /*
- * Output:
- * á é ő ű
- * á é ő ű
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement