Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

19
LINES

< > BotCompany Repo | #1005232 // Test Supplementary Characters [Unicode]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1166L/8K/28K).

!752

p {
  //S s = "hello";
  S s = fromUtf8(bytesFromHex("f0908cbcf0908cb0f0908cb2")) + "."; // 3 runes and a dot
  print(s);
  for i over s: {
    bool x = isExtendedUnicodeCharacter(s, i);
    print(codePointToString(s.codePointAt(i)) + ": " + (x ? "extended unicode char" : "normal unicode char"));
    if (x) ++i;
  }
  
  S escaped = escapeMultichars(s);
  print("Escaped: " + escaped);
  assertEquals("[xchar 0001033c][xchar 00010330][xchar 00010332].", escaped);
  S unescaped = unescapeMultichars(escaped);
  assertEquals(s, unescaped);
  print("ok!");
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pnmttuucjkfb, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005232
Snippet name: Test Supplementary Characters [Unicode]
Eternal ID of this version: #1005232/1
Text MD5: 0dd4886dfd9011962db1617357c36cf4
Transpilation MD5: aea7d2347cc86960217c750a1edd0517
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-10-26 02:25:57
Source code size: 582 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 534 / 591
Referenced in: [show references]