forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvalUniEncode.test
More file actions
40 lines (27 loc) · 980 Bytes
/
Copy pathEvalUniEncode.test
File metadata and controls
40 lines (27 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
setup
// assume little-endian for now
// first 128 chars are the same on all platforms & map directly to unicode chars
repeat with i = 0 to 127
test uniEncode(numToChar(i)) is numToByte(i) & numToByte(0)
end repeat
if the platform is "win32" then
// Windows-1252
// test char 128 (euro symbol) mapping to unicode codepoint 20AC
test uniEncode(numToChar(128)) is binaryEncode("H4", "AC20")
// chars 160 to 255 map directly to unicode
repeat with i = 160 to 255
test uniEncode(numToChar(i)) is numToByte(i) & numToByte(0)
end repeat
else if the platform is "MacOS" then
// test char 219 (euro symbol) mapping to unicode codepoint 20AC
test uniEncode(numToChar(219)) is binaryEncode("H4", "AC20")
else if the platform is "Linux" then
// ISO 8859-1 - maps directly to first 256 Unicode chars
repeat with i = 128 to 255
test uniEncode(numToChar(i)) is numToByte(i) & numToByte(0)
end repeat
else
// TODO - add this platform :)
test false
end if
teardown