Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
|
|
@ -1,6 +1,6 @@
|
|||
As the world gets smaller each day, internationalization becomes more and more important. For handling multiple languages, [[Unicode]] is your best friend.
|
||||
|
||||
It is a very capable and [https://www.youtube.com/watch?v=MijmeoH9LT4 remarquable] tool, but also quite complex compared to older single- and double-byte character encodings.
|
||||
It is a very capable and [https://www.youtube.com/watch?v=MijmeoH9LT4 remarkable] tool, but also quite complex compared to older single- and double-byte character encodings.
|
||||
|
||||
How well prepared is your programming language for Unicode?
|
||||
|
||||
|
|
|
|||
14
Task/Unicode-strings/EasyLang/unicode-strings.easy
Normal file
14
Task/Unicode-strings/EasyLang/unicode-strings.easy
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
s$ = "你好 😀"
|
||||
print len s$
|
||||
for c$ in strchars s$
|
||||
print c$ & " " & strcode c$
|
||||
.
|
||||
print strpos s$ "好"
|
||||
print strchar 128512
|
||||
print s$
|
||||
flag$ = "🇮🇹"
|
||||
print flag$
|
||||
print len flag$
|
||||
for c$ in strchars flag$
|
||||
print c$ & " " & strcode c$
|
||||
.
|
||||
26
Task/Unicode-strings/Pluto/unicode-strings.pluto
Normal file
26
Task/Unicode-strings/Pluto/unicode-strings.pluto
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
require "uchar"
|
||||
require "gchar"
|
||||
local fmt = require("fmt")
|
||||
|
||||
local w = "voilà"
|
||||
local u = uchar.of(w)
|
||||
for i = 1, u:len() do
|
||||
io.write($"{u:get(i)} ") -- prints the 5 Unicode 'characters'
|
||||
end
|
||||
print($"\nThe length of {w} is {u:len()}")
|
||||
|
||||
print("\nIts code-points are:")
|
||||
fmt.lprint(u:tocodes(), " ", "") -- prints the code-points as numbers
|
||||
|
||||
print("\n\nIts bytes are: ")
|
||||
fmt.lprint(u:tobytes(), " ", "") -- prints the bytes as numbers
|
||||
|
||||
local zwe = "👨👩👧"
|
||||
local g = gchar.of(zwe)
|
||||
local codepoints = g:tocodes()
|
||||
local bytes = g:tobytes()
|
||||
|
||||
print($"\n\n{zwe} has:")
|
||||
fmt.print(" %d bytes: %s", #bytes, fmt.swrite(bytes, " ", ""))
|
||||
fmt.print(" %d code-points: %s", #codepoints, fmt.swrite(codepoints, " ", ""))
|
||||
fmt.print(" %d grapheme", g:len())
|
||||
Loading…
Add table
Add a link
Reference in a new issue