Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Character-codes/Ecstasy/character-codes.ecstasy
Normal file
19
Task/Character-codes/Ecstasy/character-codes.ecstasy
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
module CharacterCodes {
|
||||
@Inject Console console;
|
||||
void run() {
|
||||
for (Char char : ['\0', '\d', 'A', '$', '¢', '~', '˜']) {
|
||||
// character to its integer value
|
||||
UInt32 codepoint = char.codepoint;
|
||||
|
||||
// integer value back to its character value
|
||||
Char fromCodePoint = codepoint.toChar(); // or: "new Char(codepoint)"
|
||||
|
||||
console.print($|Character {char.quoted()}:\
|
||||
| Unicode codepoint={char.codepoint},\
|
||||
| ASCII={char.ascii},\
|
||||
| UTF8 bytes={char.utf8()},\
|
||||
| char from codepoint={fromCodePoint.quoted()}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue