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).

1  
!752
2  
3  
p {
4  
  //S s = "hello";
5  
  S s = fromUtf8(bytesFromHex("f0908cbcf0908cb0f0908cb2")) + "."; // 3 runes and a dot
6  
  print(s);
7  
  for i over s: {
8  
    bool x = isExtendedUnicodeCharacter(s, i);
9  
    print(codePointToString(s.codePointAt(i)) + ": " + (x ? "extended unicode char" : "normal unicode char"));
10  
    if (x) ++i;
11  
  }
12  
  
13  
  S escaped = escapeMultichars(s);
14  
  print("Escaped: " + escaped);
15  
  assertEquals("[xchar 0001033c][xchar 00010330][xchar 00010332].", escaped);
16  
  S unescaped = unescapeMultichars(escaped);
17  
  assertEquals(s, unescaped);
18  
  print("ok!");
19  
}

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: 540 / 602
Referenced in: [show references]