author | Patrik Svestka <patrik.svestka@gmail.com> |
Tue, 09 Apr 2019 11:34:04 +0200 | |
branch | jv |
changeset 24093 | 0f94f6c8c9d4 |
parent 23547 | c69c97cec351 |
child 24912 | 7006451380c4 |
permissions | -rw-r--r-- |
23547
c69c97cec351
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
21024
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
c69c97cec351
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
21024
diff
changeset
|
2 |
|
1 | 3 |
" |
5 | 4 |
COPYRIGHT (c) 1988 by Claus Gittinger |
154 | 5 |
All Rights Reserved |
1 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
5407 | 14 |
"{ Package: 'stx:libbasic' }" |
15 |
||
17346 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
1 | 18 |
Magnitude subclass:#Character |
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
19 |
instanceVariableNames:'asciivalue' |
17249 | 20 |
classVariableNames:'CharacterTable Separators' |
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
21 |
poolDictionaries:'' |
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
22 |
category:'Magnitude-General' |
1 | 23 |
! |
24 |
||
2124 | 25 |
!Character class methodsFor:'documentation'! |
54 | 26 |
|
88 | 27 |
copyright |
28 |
" |
|
29 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
154 | 30 |
All Rights Reserved |
88 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
54 | 41 |
documentation |
42 |
" |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
43 |
This class represents characters. |
7897 | 44 |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
45 |
Notice, that actual character objects are not used when characters |
17249 | 46 |
are stored in strings, symbols etc. |
47 |
These only store a character's asciiValue/codePoint for a more compact representation. |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
48 |
The word 'asciiValue' is a historic leftover - actually, any integer |
8028 | 49 |
code is allowed and actually used (i.e. characters are not limited to 8bit). |
17249 | 50 |
Also, the encoding is actually Unicode, of which ascii is a subset and the same encoding value |
51 |
for the first 128 characters (codePoint 0 to 127 are the same in ascii). |
|
52 |
||
18215 | 53 |
Some heavily used Characters are kept as singletons; i.e. for every asciiValue (0..N), |
17249 | 54 |
there exists exactly one instance of Character, which is shared. |
55 |
Character value:xxx checks for this, and returns a reference to an existing instance. |
|
56 |
For N<=255, this is guaranteed; i.e. in all Smalltalks, the single byte characters are always |
|
57 |
handled like this, and you can therefore safely compare them using == (identity compare). |
|
58 |
||
59 |
Other characters (i.e. codepoint > N) are not guaranteed to be shared; |
|
18215 | 60 |
i.e. these my or may not be created as required. |
17249 | 61 |
Actually, do NOT depend on which characters are and which are not shared. |
62 |
Always compare using #= if there is any chance of a non-ascii character being involved. |
|
63 |
||
64 |
Once again (because beginners sometimes make this mistake): |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
65 |
This means: you may compare characters using #== ONLY IFF you are certain, |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
66 |
that the characters ranges is 0..255. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
67 |
Otherwise, you HAVE TO compare using #=. (if in doubt, always compare using #=). |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
68 |
Sorry for this inconvenience, but it is (practically) impossible to keep |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
69 |
the possible maximum of 2^32 characters (Unicode) around, for that convenience alone. |
17249 | 70 |
|
71 |
In ST/X, N is (currently) 1024. This means that all the latin characters and some others are |
|
72 |
kept as singleton in the CharacterTable class variable (which is also used by the VM when characters |
|
20088 | 73 |
are instantiated). |
357 | 74 |
|
68 | 75 |
Methods marked as (JS) come from the manchester Character goody |
76 |
(CharacterComparing) by Jan Steinman, which allow Characters to be used as |
|
9153 | 77 |
Interval elements (i.e. ($a to:$z) do:[...] ); |
1229 | 78 |
They are not a big deal, but convenient add-ons. |
79 |
Some of these have been modified a bit. |
|
1 | 80 |
|
68 | 81 |
WARNING: characters are known by compiler and runtime system - |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
82 |
do not change the instance layout. |
357 | 83 |
|
84 |
Also, although you can create subclasses of Character, the compiler always |
|
85 |
creates instances of Character for literals ... |
|
814
d4d28ca7afcd
made the global CharacterTable a classVar of Character
Claus Gittinger <cg@exept.de>
parents:
760
diff
changeset
|
86 |
... and other classes are hard-wired to always return instances of characters |
357 | 87 |
in some cases (i.e. String>>at:, Symbol>>at: etc.). |
88 |
Therefore, it may not make sense to create a character-subclass. |
|
1295 | 89 |
|
8028 | 90 |
Case Mapping in Unicode: |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
91 |
There are a number of complications to case mappings that occur once the repertoire |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
92 |
of characters is expanded beyond ASCII. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
93 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
94 |
* Because of the inclusion of certain composite characters for compatibility, |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
95 |
such as U+01F1 'DZ' capital dz, there is a third case, called titlecase, |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
96 |
which is used where the first letter of a word is to be capitalized |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
97 |
(e.g. Titlecase, vs. UPPERCASE, or lowercase). |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
98 |
For example, the title case of the example character is U+01F2 'Dz' capital d with small z. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
99 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
100 |
* Case mappings may produce strings of different length than the original. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
101 |
For example, the German character U+00DF small letter sharp s expands when uppercased to |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
102 |
the sequence of two characters 'SS'. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
103 |
This also occurs where there is no precomposed character corresponding to a case mapping. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
104 |
*** This is not yet implemented (in 5.2) *** |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
105 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
106 |
* Characters may also have different case mappings, depending on the context. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
107 |
For example, U+03A3 capital sigma lowercases to U+03C3 small sigma if it is not followed |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
108 |
by another letter, but lowercases to 03C2 small final sigma if it is. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
109 |
*** This is not yet implemented (in 5.2) *** |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
110 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
111 |
* Characters may have case mappings that depend on the locale. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
112 |
For example, in Turkish the letter 0049 'I' capital letter i lowercases to 0131 small dotless i. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
113 |
*** This is not yet implemented (in 5.2) *** |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
114 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
115 |
* Case mappings are not, in general, reversible. |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
116 |
For example, once the string 'McGowan' has been uppercased, lowercased or titlecased, |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
117 |
the original cannot be recovered by applying another uppercase, lowercase, or titlecase operation. |
8028 | 118 |
|
119 |
Collation Sequence: |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
120 |
*** This is not yet implemented (in 5.2) *** |
8028 | 121 |
|
1295 | 122 |
[author:] |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
123 |
Claus Gittinger |
1295 | 124 |
|
125 |
[see also:] |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
126 |
String TwoByteString Unicode16String Unicode32String |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
127 |
StringCollection Text |
54 | 128 |
" |
129 |
! ! |
|
1 | 130 |
|
2124 | 131 |
!Character class methodsFor:'instance creation'! |
1 | 132 |
|
133 |
basicNew |
|
134 |
"catch new - Characters cannot be created with new" |
|
135 |
||
136 |
^ self error:'Characters cannot be created with new' |
|
137 |
! |
|
138 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
139 |
codePoint:anInteger |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
140 |
"return a character with codePoint anInteger" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
141 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
142 |
%{ /* NOCONTEXT */ |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18215
diff
changeset
|
143 |
#ifdef __SCHTEAM__ |
18215 | 144 |
{ |
145 |
char ch = (char)(context.stArg(0).intValue("[codePoint:]")); |
|
146 |
||
147 |
return context._RETURN(STCharacter._new(ch)); |
|
148 |
} |
|
149 |
/* NOTREACHED */ |
|
150 |
#else |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
151 |
INT __codePoint; |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
152 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
153 |
if (__isSmallInteger(anInteger)) { |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
154 |
__codePoint = __smallIntegerVal(anInteger); |
14684 | 155 |
if ((unsigned INT)(__codePoint) <= MAX_IMMEDIATE_CHARACTER /* (__codePoint >= 0) && (__codePoint <= 255) */) { |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
156 |
RETURN ( __MKCHARACTER(__codePoint) ); |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
157 |
} else { |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
158 |
RETURN ( __MKUCHARACTER(__codePoint) ); |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
159 |
} |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
160 |
} |
18215 | 161 |
#endif |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
162 |
%}. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
163 |
(anInteger between:0 and:(CharacterTable size - 1)) ifTrue:[ |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
164 |
^ CharacterTable at:(anInteger + 1) |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
165 |
]. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
166 |
(anInteger between:16r100 and:16r3FFFFFFF) ifTrue:[ |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
167 |
^ super basicNew setCodePoint:anInteger |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
168 |
]. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
169 |
" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
170 |
a characters codePoint must be 0..16r3FFFFFFF. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
171 |
(i.e. only characters with up-to 30 bits are allowed.) |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
172 |
" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
173 |
RangeError raiseWith:anInteger errorString:'invalid codePoint for character' |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
174 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
175 |
" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
176 |
self codePoint:16r34. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
177 |
self codePoint:16r3455. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
178 |
self codePoint:16rFFFFFFFFFFFFFFFFFFF. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
179 |
" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
180 |
! |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
181 |
|
699 | 182 |
digitValue:anInteger |
183 |
"return a character that corresponds to anInteger. |
|
184 |
0-9 map to $0-$9, 10-35 map to $A-$Z" |
|
185 |
||
186 |
|val "{ Class: SmallInteger }" | |
|
187 |
||
188 |
val := anInteger. |
|
189 |
(val between:0 and:9) ifTrue:[ |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
190 |
^ Character codePoint:(val + ($0 codePoint)) |
699 | 191 |
]. |
192 |
(val between:10 and:35) ifTrue:[ |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
193 |
^ Character codePoint:(val + ($A codePoint - 10)) |
699 | 194 |
]. |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
195 |
^ self error:'value not in range 0 to 35' |
699 | 196 |
! |
197 |
||
6808 | 198 |
utf8DecodeFrom:aStream |
199 |
"read and return a single unicode character from an UTF8 encoded stream" |
|
200 |
||
18605 | 201 |
|fetchNext c1 c2 codePoint| |
6808 | 202 |
|
203 |
c1 := aStream next. |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
204 |
codePoint := c1 codePoint. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
205 |
codePoint <= 16r7F ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
206 |
"/ 0xxxxxxx - 7 bits |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
207 |
^ c1 asCharacter. |
6808 | 208 |
]. |
209 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
210 |
(codePoint bitAnd:2r11000000) == 2r10000000 ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
211 |
"/ out of sync (got an intermediate character) |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
212 |
InvalidEncodingError raiseRequestWith:codePoint errorString:' - out of sync'. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
213 |
^ c1 asCharacter. |
6808 | 214 |
]. |
215 |
||
18605 | 216 |
fetchNext := [ |code| |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
217 |
code := aStream next codePoint. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
218 |
(code bitAnd:2r11000000) == 2r10000000 ifFalse:[ |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
219 |
"/ followup chars must have 2r10 in high bits |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
220 |
InvalidEncodingError raiseRequestWith:code. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
221 |
^ c1 asCharacter. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
222 |
]. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
223 |
code bitAnd:16r3F |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
224 |
]. |
6808 | 225 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
226 |
(codePoint bitAnd:2r11100000) == 2r11000000 ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
227 |
"/ 110xxxxx 10xxxxxx - 11 bits |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
228 |
codePoint := codePoint bitAnd:16r1F. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
229 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
230 |
codePoint <= 16r7F ifTrue:[ |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
231 |
InvalidEncodingError raiseRequestWith:codePoint. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
232 |
]. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
233 |
^ Character codePoint:codePoint |
6808 | 234 |
]. |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
235 |
(codePoint bitAnd:2r11110000) == 2r11100000 ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
236 |
"/ 1110xxxx 10xxxxxx 10xxxxxx - 16 bits |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
237 |
codePoint := codePoint bitAnd:16r0F. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
238 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
239 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
240 |
codePoint <= 16r7FF ifTrue:[ |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
241 |
InvalidEncodingError raiseRequestWith:codePoint. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
242 |
]. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
243 |
^ Character codePoint:codePoint |
6808 | 244 |
]. |
245 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
246 |
(codePoint bitAnd:2r11111000) == 2r11110000 ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
247 |
"/ 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - 21 bits |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
248 |
codePoint := codePoint bitAnd:16r07. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
249 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
250 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
251 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
252 |
codePoint <= 16rFFFF ifTrue:[ |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
253 |
InvalidEncodingError raiseRequestWith:codePoint. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
254 |
]. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
255 |
^ Character codePoint:codePoint |
6808 | 256 |
]. |
257 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
258 |
(codePoint bitAnd:2r11111100) == 2r11111000 ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
259 |
"/ 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx - 26 bits |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
260 |
codePoint := codePoint bitAnd:16r03. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
261 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
262 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
263 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
264 |
codePoint := (codePoint bitShift:6) bitOr:(fetchNext value). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
265 |
codePoint <= 16r1FFFFF ifTrue:[ |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
266 |
InvalidEncodingError raiseRequestWith:codePoint. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
267 |
]. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
268 |
^ Character codePoint:codePoint |
6808 | 269 |
]. |
270 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
271 |
(codePoint bitAnd:2r11111110) == 2r11111100 ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
272 |
"/ 1111110x ... 10xxxxxx - any number of bits |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
273 |
codePoint := codePoint bitAnd:16r01. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
274 |
|
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
275 |
c2 := aStream peek. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
276 |
[c2 notNil and:[(c2 codePoint bitAnd:2r11000000) == 2r10000000]] whileTrue:[ |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
277 |
codePoint := (codePoint bitShift:6) bitOr:(c2 codePoint bitAnd:16r3F). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
278 |
aStream next. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
279 |
c2 := aStream peek. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
280 |
]. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
281 |
codePoint <= 16r3FFFFFF ifTrue:[ |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
282 |
InvalidEncodingError raiseRequestWith:codePoint. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
283 |
]. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
284 |
^ Character codePoint:codePoint |
6808 | 285 |
]. |
286 |
||
11325
b2ba4174deb8
Raise InvalidEncodingError when utf8 decode fails
Stefan Vogel <sv@exept.de>
parents:
11321
diff
changeset
|
287 |
InvalidEncodingError raiseRequestWith:codePoint. |
18605 | 288 |
^ c1 asCharacter. |
6808 | 289 |
|
290 |
" |
|
9153 | 291 |
Character utf8DecodeFrom:'a' readStream |
292 |
Character utf8DecodeFrom:#[195 188] asString readStream |
|
293 |
" |
|
6808 | 294 |
|
295 |
"test: |
|
296 |
||
297 |
|utf8Encoding original readBack| |
|
298 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
299 |
1 to:16rFFFF do:[:codePoint | |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
300 |
original := Character value:codePoint. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
301 |
utf8Encoding := original utf8Encoded. |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
302 |
readBack := Character utf8DecodeFrom:(utf8Encoding readStream). |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
303 |
readBack codePoint = codePoint ifFalse:[ |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
304 |
self halt |
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
305 |
] |
6808 | 306 |
] |
307 |
" |
|
308 |
! |
|
309 |
||
1 | 310 |
value:anInteger |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
311 |
"return a character with codePoint anInteger - backward compatibility" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
312 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
313 |
^ self codePoint:anInteger |
5945 | 314 |
! ! |
315 |
||
2214 | 316 |
!Character class methodsFor:'accessing untypeable characters'! |
317 |
||
15689 | 318 |
controlCharacter:char |
319 |
"Answer the Character representing ctrl-char. |
|
320 |
ctrl-a -> 1; ctrl-@ -> 0" |
|
321 |
||
322 |
char == $@ ifTrue:[^ self codePoint:0]. |
|
323 |
self assert:char isLetter. |
|
324 |
^ self codePoint:(char asLowercase - $a + 1) |
|
325 |
||
326 |
" |
|
327 |
self controlCharacter:$@ |
|
328 |
self controlCharacter:$d |
|
329 |
" |
|
330 |
! |
|
331 |
||
2214 | 332 |
endOfInput |
11144 | 333 |
"Answer the Character representing ctrl-d (Unix-EOF)." |
9153 | 334 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
335 |
^ self codePoint:4 |
2214 | 336 |
! |
337 |
||
338 |
leftParenthesis |
|
8097 | 339 |
"Answer the Character representing a left parenthesis." |
9153 | 340 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
341 |
^ self codePoint:40 |
2214 | 342 |
! |
343 |
||
344 |
period |
|
8097 | 345 |
"Answer the Character representing a carriage period." |
9153 | 346 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
347 |
^ self codePoint:46 |
2214 | 348 |
! |
349 |
||
350 |
poundSign |
|
11144 | 351 |
"Answer the Character representing a pound sign (hash)." |
9153 | 352 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
353 |
^ self codePoint:35 |
2214 | 354 |
! |
355 |
||
356 |
rightParenthesis |
|
8097 | 357 |
"Answer the Character representing a right parenthesis." |
9153 | 358 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
359 |
^ self codePoint:41 |
2214 | 360 |
! ! |
361 |
||
2124 | 362 |
!Character class methodsFor:'constants'! |
699 | 363 |
|
364 |
backspace |
|
365 |
"return the backspace character" |
|
366 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
367 |
^ Character codePoint:8 |
699 | 368 |
! |
369 |
||
370 |
bell |
|
371 |
"return the bell character" |
|
372 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
373 |
^ Character codePoint:7 |
699 | 374 |
! |
375 |
||
376 |
cr |
|
9153 | 377 |
"return the lineEnd character |
699 | 378 |
- actually (in unix) this is a newline character" |
379 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
380 |
^ Character codePoint:10 |
699 | 381 |
! |
382 |
||
9153 | 383 |
del |
699 | 384 |
"return the delete character" |
385 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
386 |
^ Character codePoint:16r7F |
699 | 387 |
! |
388 |
||
389 |
doubleQuote |
|
390 |
"return the double-quote character" |
|
391 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
392 |
^ Character codePoint:34 |
699 | 393 |
! |
394 |
||
395 |
esc |
|
396 |
"return the escape character" |
|
397 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
398 |
^ Character codePoint:27 |
699 | 399 |
! |
400 |
||
10428 | 401 |
etx |
402 |
"return the end-of-text character" |
|
403 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
404 |
^ Character codePoint:3 |
10428 | 405 |
! |
406 |
||
7688 | 407 |
euro |
7689 | 408 |
"The Euro currency sign (notice: not all fonts support it). |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
409 |
The Unicode encoding is U+20AC" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
410 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
411 |
^ Character codePoint:16r20AC |
7689 | 412 |
|
413 |
" |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
414 |
Transcript font:(Font family:'courier' size:12 encoding:'iso10646-1'). |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
415 |
Transcript showCR:Character euro |
7976 | 416 |
" |
417 |
" |
|
7689 | 418 |
0 to:255 do:[:i | |
14684 | 419 |
Transcript |
420 |
show:'| '; show:((i printStringRadix:16) leftPaddedTo:2); |
|
421 |
show:' | '; show:(i printStringPaddedTo:3); |
|
422 |
show:' | '; show:(Character value:i); |
|
423 |
cr. |
|
7689 | 424 |
] |
425 |
" |
|
7688 | 426 |
! |
427 |
||
699 | 428 |
excla |
429 |
"return the exclamation-mark character" |
|
430 |
^ $!! |
|
1 | 431 |
! |
432 |
||
699 | 433 |
ff |
434 |
"return the form-feed character" |
|
435 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
436 |
^ Character codePoint:12 |
699 | 437 |
! |
438 |
||
439 |
lf |
|
440 |
"return the newline/linefeed character" |
|
441 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
442 |
^ Character codePoint:10 |
699 | 443 |
! |
1 | 444 |
|
4340
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
445 |
linefeed |
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
446 |
"squeak compatibility: return the newline/linefeed character" |
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
447 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
448 |
^ Character codePoint:10 |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
449 |
! |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
450 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
451 |
maxImmediateCodePoint |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
452 |
"return the maximum codePoint until which the characters are shared" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
453 |
%{ /* NOCONTEXT */ |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
454 |
RETURN(__mkSmallInteger(MAX_IMMEDIATE_CHARACTER)); |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
455 |
%}. |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
456 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
457 |
" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
458 |
self maxImmediateCodePoint |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
459 |
" |
4340
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
460 |
! |
523ef8410fad
added #linefeed - squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4337
diff
changeset
|
461 |
|
9153 | 462 |
maxValue |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
463 |
"return the maximum codePoint a character may have" |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
464 |
|
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
465 |
^ 16r3FFFFFFF |
699 | 466 |
! |
467 |
||
468 |
newPage |
|
469 |
"return the form-feed character" |
|
470 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
471 |
^ Character codePoint:12 |
699 | 472 |
! |
473 |
||
474 |
nl |
|
475 |
"return the newline character" |
|
68 | 476 |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
477 |
^ Character codePoint:10 |
699 | 478 |
! |
479 |
||
6324 | 480 |
null |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
481 |
^ Character codePoint:0 |
6324 | 482 |
! |
483 |
||
699 | 484 |
quote |
485 |
"return the single-quote character" |
|
486 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
487 |
^ Character codePoint:39 |
699 | 488 |
! |
489 |
||
9153 | 490 |
return |
699 | 491 |
"return the return character. |
492 |
In ST/X, this is different from cr - for Unix reasons." |
|
493 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
494 |
^ Character codePoint:13 |
699 | 495 |
! |
496 |
||
497 |
space |
|
498 |
"return the blank character" |
|
499 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
500 |
^ Character codePoint:32 |
699 | 501 |
! |
502 |
||
503 |
tab |
|
504 |
"return the tabulator character" |
|
505 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
506 |
^ Character codePoint:9 |
1 | 507 |
! ! |
508 |
||
2124 | 509 |
!Character class methodsFor:'primitive input'! |
1 | 510 |
|
511 |
fromUser |
|
357 | 512 |
"return a character from the keyboard (C's standard input stream) |
1 | 513 |
- this should only be used for emergency evaluators and the like." |
514 |
||
515 |
%{ /* NOCONTEXT */ |
|
18691 | 516 |
# include <errno.h> |
517 |
||
1 | 518 |
int c; |
519 |
||
18691 | 520 |
for (;;) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
521 |
c = getchar(); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
522 |
if (c >= 0) break; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
523 |
if (errno != EINTR) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
524 |
RETURN (nil); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
525 |
} |
1 | 526 |
} |
1133 | 527 |
RETURN ( __MKCHARACTER(c & 0xFF) ); |
5433 | 528 |
%}. |
19378 | 529 |
^ Processor activeProcess stdin next |
1 | 530 |
! ! |
531 |
||
2124 | 532 |
!Character class methodsFor:'queries'! |
3 | 533 |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
534 |
allCharacters |
17249 | 535 |
"added for squeak compatibility: return a collection of all singleton chars. |
536 |
Notice, for memory efficiency reasons, only some of the low-codepoint characters |
|
537 |
are actually kept as singletons. less frequently used character instances are created on the fly, |
|
538 |
as wide string elements are accessed (and hopefully garbage collected sooner or later)" |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
539 |
|
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
540 |
^ CharacterTable |
9153 | 541 |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
542 |
" |
9153 | 543 |
Character allCharacters |
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
544 |
" |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
545 |
! |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
546 |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
547 |
hasSharedInstances |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
548 |
"return true if this class has shared instances, that is, instances |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
549 |
with the same value are identical. |
9148 | 550 |
Although not always shared (TwoByte CodePoint-Characters), these should be treated |
551 |
so, to be independent of the number of the underlying implementation" |
|
2672
dc3662188b2c
added #hasImmediateInstances for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
552 |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
553 |
^ true |
2672
dc3662188b2c
added #hasImmediateInstances for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
554 |
! |
dc3662188b2c
added #hasImmediateInstances for VW compatibility
Claus Gittinger <cg@exept.de>
parents:
2561
diff
changeset
|
555 |
|
3 | 556 |
isBuiltInClass |
1271 | 557 |
"return true if this class is known by the run-time-system. |
558 |
Here, true is returned for myself, false for subclasses." |
|
3 | 559 |
|
560 |
^ self == Character |
|
1271 | 561 |
|
562 |
"Modified: 23.4.1996 / 15:56:39 / cg" |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
563 |
! |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
564 |
|
8206 | 565 |
isLegalUnicodeCodePoint:anInteger |
566 |
"answer true, if anInteger is a valid unicode code point" |
|
567 |
||
9153 | 568 |
"Range 16rD800 - 16rDFFF is reserved for the |
8207
12131fc77a99
#isLegalUnicodeCodePoint: - Fix comment
Stefan Vogel <sv@exept.de>
parents:
8206
diff
changeset
|
569 |
lower and upper substitution page for UCS-16" |
8206 | 570 |
(anInteger >= 16rD800) ifTrue:[ |
9153 | 571 |
(anInteger <= 16rDFFF) ifTrue:[ |
572 |
^ false. |
|
573 |
]. |
|
574 |
(anInteger == 16rFFFE) ifTrue:[ |
|
575 |
^ false. |
|
576 |
]. |
|
577 |
(anInteger == 16rFFFF) ifTrue:[ |
|
578 |
^ false. |
|
579 |
]. |
|
8206 | 580 |
]. |
581 |
^ true |
|
582 |
! |
|
583 |
||
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
584 |
separators |
17249 | 585 |
"return a collection of separator chars. |
586 |
Added for squeak compatibility" |
|
587 |
||
588 |
Separators isNil ifTrue:[ |
|
18215 | 589 |
Separators := Array |
590 |
with:Character space |
|
591 |
with:Character return |
|
592 |
"/ with:Character cr |
|
593 |
with:Character tab |
|
594 |
with:Character lf |
|
595 |
with:Character ff |
|
17249 | 596 |
]. |
597 |
^ Separators |
|
9153 | 598 |
|
4337
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
599 |
" |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
600 |
Character separators |
07fad5b7af9b
added #allCharacters & #separators for Squeak compatibility
Claus Gittinger <cg@exept.de>
parents:
4037
diff
changeset
|
601 |
" |
3 | 602 |
! ! |
603 |
||
7261 | 604 |
!Character methodsFor:'Compatibility-Dolphin'! |
6324 | 605 |
|
7351
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
606 |
isAlphaNumeric |
18805 | 607 |
"Compatibility method for dolphin and VSE - do not use in new code. |
11956 | 608 |
Return true, if I am a letter or a digit |
7351
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
609 |
Please use isLetterOrDigit for compatibility reasons (which is ANSI)." |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
610 |
|
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
611 |
^ self isLetterOrDigit |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
612 |
! |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
613 |
|
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
614 |
isAlphabetic |
11956 | 615 |
"Compatibility method - do not use in new code. |
616 |
Return true, if I am a letter. |
|
7351
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
617 |
Please use isLetter for compatibility reasons (which is ANSI)." |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
618 |
|
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
619 |
^ self isLetter |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
620 |
! |
1f805a32d551
comments in isAlphaNumeric and isAlphabetic
Claus Gittinger <cg@exept.de>
parents:
7300
diff
changeset
|
621 |
|
6324 | 622 |
isControl |
11956 | 623 |
"Compatibility method - do not use in new code. |
624 |
Return true if I am a control character (i.e. ascii value < 32)" |
|
7353 | 625 |
|
626 |
^ self isControlCharacter |
|
6324 | 627 |
! |
628 |
||
629 |
isHexDigit |
|
7354 | 630 |
"return true if I am a valid hexadecimal digit" |
631 |
||
6324 | 632 |
^ '0123456789abcdefABCDEF' includes:self |
7354 | 633 |
|
634 |
" |
|
635 |
$a isHexDigit |
|
636 |
" |
|
6324 | 637 |
! |
638 |
||
639 |
isPunctuation |
|
11956 | 640 |
"Compatibility method - do not use in new code. |
641 |
The code below is not unicode aware" |
|
7897 | 642 |
|
6327 | 643 |
^ (asciivalue between:16r21 and:16r40) |
644 |
or:[ (asciivalue between:16r5B and:16r60) |
|
645 |
or:[ (asciivalue between:123 and:126) |
|
646 |
or:[ (asciivalue between:161 and:191) |
|
647 |
or:[ (asciivalue == 215 ) |
|
648 |
or:[ (asciivalue == 247 ) ]]]]] |
|
6324 | 649 |
! ! |
650 |
||
1 | 651 |
!Character methodsFor:'accessing'! |
652 |
||
8097 | 653 |
codePoint |
654 |
"return the codePoint of myself. |
|
9153 | 655 |
Traditionally, this was named 'asciiValue'; |
8097 | 656 |
however, characters are not limited to 8bit characters." |
657 |
||
658 |
^ asciivalue |
|
659 |
! |
|
660 |
||
1 | 661 |
instVarAt:index put:anObject |
54 | 662 |
"catch instvar access - asciivalue may not be changed" |
1 | 663 |
|
664 |
self error:'Characters may not be modified' |
|
665 |
! ! |
|
666 |
||
699 | 667 |
!Character methodsFor:'arithmetic'! |
1 | 668 |
|
669 |
+ aMagnitude |
|
9153 | 670 |
"Return the Character that is <aMagnitude> higher than the receiver. |
1 | 671 |
Wrap if the resulting value is not a legal Character value. (JS)" |
672 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
673 |
^ Character codePoint:((asciivalue + aMagnitude asInteger) \\ 16r3FFFFFFF) |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
674 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
675 |
" |
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
676 |
$A + 5 |
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
677 |
" |
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
678 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
679 |
"Modified: 27.6.1996 / 12:34:51 / cg" |
1 | 680 |
! |
681 |
||
682 |
- aMagnitude |
|
9153 | 683 |
"Return the Character that is <aMagnitude> lower than the receiver. |
68 | 684 |
Wrap if the resulting value is not a legal Character value. (JS) |
9153 | 685 |
claus: |
686 |
modified to return the difference as integer, if the argument |
|
687 |
is another character. If the argument is a number, a character is |
|
688 |
returned." |
|
1 | 689 |
|
68 | 690 |
aMagnitude isCharacter ifTrue:[ |
9153 | 691 |
^ asciivalue - aMagnitude asInteger |
68 | 692 |
]. |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
693 |
^ Character codePoint:((asciivalue - aMagnitude asInteger) \\ 16r3FFFFFFF) |
68 | 694 |
|
695 |
" |
|
9153 | 696 |
$z - $a |
68 | 697 |
$d - 3 |
698 |
" |
|
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
699 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
700 |
"Modified: 27.6.1996 / 12:35:34 / cg" |
1 | 701 |
! |
702 |
||
703 |
// aMagnitude |
|
9153 | 704 |
"Return the Character who's value is the receiver divided by <aMagnitude>. |
1 | 705 |
Wrap if the resulting value is not a legal Character value. (JS)" |
706 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
707 |
^ Character codePoint:(asciivalue // aMagnitude asInteger \\ 16r3FFFFFFF) |
1 | 708 |
! |
709 |
||
710 |
\\ aMagnitude |
|
9153 | 711 |
"Return the Character who's value is the receiver modulo <aMagnitude>. |
1 | 712 |
Wrap if the resulting value is not a legal Character value. (JS)" |
713 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
714 |
^ Character codePoint:(asciivalue \\ aMagnitude asInteger \\ 16r3FFFFFFF) |
1 | 715 |
! ! |
716 |
||
699 | 717 |
|
718 |
!Character methodsFor:'comparing'! |
|
719 |
||
8143 | 720 |
< aMagnitude |
7799 | 721 |
"return true, if the arguments asciiValue is greater than the receiver's" |
699 | 722 |
|
8143 | 723 |
^ (asciivalue < aMagnitude asInteger) |
699 | 724 |
! |
725 |
||
8143 | 726 |
<= aMagnitude |
7799 | 727 |
"return true, if the arguments asciiValue is greater or equal to the receiver's" |
699 | 728 |
|
8143 | 729 |
^ (asciivalue <= aMagnitude asInteger) |
699 | 730 |
! |
731 |
||
732 |
= aCharacter |
|
733 |
"return true, if the argument, aCharacter is the same character |
|
8143 | 734 |
Redefined to take care of character sizes > 8bit." |
18298 | 735 |
%{ |
736 |
#ifdef __SCHTEAM__ |
|
737 |
if (self == aCharacter) { |
|
738 |
return context._RETURN_true(); |
|
739 |
} |
|
740 |
if (aCharacter.characterP() == STObject.True) { |
|
741 |
if (self.charValue() == aCharacter.charValue()) { |
|
742 |
return context._RETURN_true(); |
|
743 |
} else { |
|
744 |
return context._RETURN_false(); |
|
745 |
} |
|
746 |
} |
|
747 |
#endif /* not SCHTEAM */ |
|
748 |
%}. |
|
699 | 749 |
self == aCharacter ifTrue:[^ true]. |
750 |
aCharacter isCharacter ifFalse:[^ false]. |
|
8143 | 751 |
^ asciivalue = aCharacter codePoint |
752 |
||
753 |
" |
|
18215 | 754 |
$A = (Character value:65) |
755 |
$A = (Character codePoint:65) |
|
756 |
$A = ($B-1) |
|
757 |
$A = 65 |
|
8143 | 758 |
" |
699 | 759 |
! |
760 |
||
8143 | 761 |
> aMagnitude |
7799 | 762 |
"return true, if the arguments asciiValue is less than the receiver's" |
699 | 763 |
|
8143 | 764 |
^ (asciivalue > aMagnitude asInteger) |
699 | 765 |
! |
766 |
||
8143 | 767 |
>= aMagnitude |
7799 | 768 |
"return true, if the arguments asciiValue is less or equal to the receiver's" |
699 | 769 |
|
8143 | 770 |
^ (asciivalue >= aMagnitude asInteger) |
699 | 771 |
! |
772 |
||
5540 | 773 |
hash |
774 |
"return an integer useful for hashing" |
|
775 |
||
776 |
^ asciivalue |
|
777 |
! |
|
778 |
||
699 | 779 |
identityHash |
780 |
"return an integer useful for hashing on identity" |
|
781 |
||
9153 | 782 |
%{ |
8100 | 783 |
INT __codePoint; |
784 |
||
785 |
__codePoint = __smallIntegerVal(__INST(asciivalue)); |
|
786 |
||
787 |
if (__codePoint <= MAX_IMMEDIATE_CHARACTER) { |
|
9153 | 788 |
RETURN ( __mkSmallInteger(__codePoint + 4096) ); |
8100 | 789 |
} |
790 |
%}. |
|
791 |
||
699 | 792 |
^ super identityHash |
8100 | 793 |
|
794 |
" |
|
795 |
$a identityHash. |
|
796 |
(Character value:1234) identityHash |
|
797 |
" |
|
699 | 798 |
! |
799 |
||
800 |
sameAs:aCharacter |
|
801 |
"return true, if the argument, aCharacter is the same character, |
|
802 |
ignoring case differences." |
|
803 |
||
804 |
self == aCharacter ifTrue:[^ true]. |
|
805 |
^ self asLowercase = aCharacter asLowercase |
|
14663 | 806 |
|
807 |
" |
|
808 |
(Character value:345) sameAs:(Character value:345) |
|
809 |
" |
|
699 | 810 |
! |
811 |
||
812 |
~= aCharacter |
|
813 |
"return true, if the argument, aCharacter is not the same character |
|
8143 | 814 |
Redefined to take care of character sizes > 8bit." |
699 | 815 |
|
816 |
self == aCharacter ifTrue:[^ false]. |
|
817 |
aCharacter isCharacter ifFalse:[^ true]. |
|
8097 | 818 |
^ (asciivalue ~~ aCharacter codePoint) |
699 | 819 |
! ! |
820 |
||
821 |
!Character methodsFor:'converting'! |
|
822 |
||
823 |
asCharacter |
|
824 |
"usually sent to integers, but redefined here to allow integers |
|
825 |
and characters to be used commonly without a need for a test." |
|
826 |
||
827 |
^ self |
|
828 |
||
829 |
" |
|
9153 | 830 |
32 asCharacter |
699 | 831 |
" |
832 |
! |
|
833 |
||
834 |
asInteger |
|
8143 | 835 |
"the same as #codePoint. |
836 |
Use #asInteger, if you need protocol compatibility with Numbers etc.. |
|
837 |
Use #codePoint in any other case for better stc optimization" |
|
699 | 838 |
|
839 |
^ asciivalue |
|
840 |
! |
|
841 |
||
842 |
asLowercase |
|
8010 | 843 |
"return a character with same letter as the receiver, but in lowercase. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
844 |
Returns the receiver if it is already lowercase or if there is no lowercase equivalent. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
845 |
CAVEAT: |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
846 |
for now, this method is only correct for unicode characters up to u+1d6ff (Unicode3.1). |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
847 |
(which is more than mozilla does, btw. ;-)" |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
848 |
|
8010 | 849 |
%{ |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18215
diff
changeset
|
850 |
#ifdef __SCHTEAM__ |
18215 | 851 |
{ |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
852 |
char ch = self.charValue("[asLowercase]"); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
853 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
854 |
ch = java.lang.Character.toLowerCase(ch); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
855 |
return context._RETURN(STCharacter._new(ch)); |
18215 | 856 |
} |
857 |
/* NOTREACHED */ |
|
858 |
#else |
|
14684 | 859 |
static int __mapping[] = { |
9153 | 860 |
/* From To Every Diff */ |
8010 | 861 |
0x0041, ((0x19 << 8) | 0x01), 0x0020 , |
862 |
0x00c0, ((0x16 << 8) | 0x01), 0x0020 , |
|
863 |
0x00d8, ((0x06 << 8) | 0x01), 0x0020 , |
|
864 |
0x0100, ((0x2e << 8) | 0x02), 0x0001 , |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
865 |
0x0130, ((0x00 << 8) | 0x00), -199 , |
8010 | 866 |
0x0132, ((0x04 << 8) | 0x02), 0x0001 , |
867 |
0x0139, ((0x0e << 8) | 0x02), 0x0001 , |
|
868 |
0x014a, ((0x2c << 8) | 0x02), 0x0001 , |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
869 |
0x0178, ((0x00 << 8) | 0x00), -121 , |
8010 | 870 |
0x0179, ((0x04 << 8) | 0x02), 0x0001 , |
871 |
0x0181, ((0x00 << 8) | 0x00), 0x00d2 , |
|
872 |
0x0182, ((0x02 << 8) | 0x02), 0x0001 , |
|
873 |
0x0186, ((0x00 << 8) | 0x00), 0x00ce , |
|
874 |
0x0187, ((0x00 << 8) | 0x00), 0x0001 , |
|
875 |
0x0189, ((0x01 << 8) | 0x01), 0x00cd , |
|
876 |
0x018b, ((0x00 << 8) | 0x00), 0x0001 , |
|
877 |
0x018e, ((0x00 << 8) | 0x00), 0x004f , |
|
878 |
0x018f, ((0x00 << 8) | 0x00), 0x00ca , |
|
879 |
0x0190, ((0x00 << 8) | 0x00), 0x00cb , |
|
880 |
0x0191, ((0x00 << 8) | 0x00), 0x0001 , |
|
881 |
0x0193, ((0x00 << 8) | 0x00), 0x00cd , |
|
882 |
0x0194, ((0x00 << 8) | 0x00), 0x00cf , |
|
883 |
0x0196, ((0x00 << 8) | 0x00), 0x00d3 , |
|
884 |
0x0197, ((0x00 << 8) | 0x00), 0x00d1 , |
|
885 |
0x0198, ((0x00 << 8) | 0x00), 0x0001 , |
|
886 |
0x019c, ((0x00 << 8) | 0x00), 0x00d3 , |
|
887 |
0x019d, ((0x00 << 8) | 0x00), 0x00d5 , |
|
888 |
0x019f, ((0x00 << 8) | 0x00), 0x00d6 , |
|
889 |
0x01a0, ((0x04 << 8) | 0x02), 0x0001 , |
|
890 |
0x01a6, ((0x00 << 8) | 0x00), 0x00da , |
|
891 |
0x01a7, ((0x00 << 8) | 0x00), 0x0001 , |
|
892 |
0x01a9, ((0x00 << 8) | 0x00), 0x00da , |
|
893 |
0x01ac, ((0x00 << 8) | 0x00), 0x0001 , |
|
894 |
0x01ae, ((0x00 << 8) | 0x00), 0x00da , |
|
895 |
0x01af, ((0x00 << 8) | 0x00), 0x0001 , |
|
896 |
0x01b1, ((0x01 << 8) | 0x01), 0x00d9 , |
|
897 |
0x01b3, ((0x02 << 8) | 0x02), 0x0001 , |
|
898 |
0x01b7, ((0x00 << 8) | 0x00), 0x00db , |
|
899 |
0x01b8, ((0x04 << 8) | 0x04), 0x0001 , |
|
900 |
0x01c4, ((0x00 << 8) | 0x00), 0x0002 , |
|
901 |
0x01c5, ((0x00 << 8) | 0x00), 0x0001 , |
|
902 |
0x01c7, ((0x00 << 8) | 0x00), 0x0002 , |
|
903 |
0x01c8, ((0x00 << 8) | 0x00), 0x0001 , |
|
904 |
0x01ca, ((0x00 << 8) | 0x00), 0x0002 , |
|
905 |
0x01cb, ((0x10 << 8) | 0x02), 0x0001 , |
|
906 |
0x01de, ((0x10 << 8) | 0x02), 0x0001 , |
|
907 |
0x01f1, ((0x00 << 8) | 0x00), 0x0002 , |
|
908 |
0x01f2, ((0x02 << 8) | 0x02), 0x0001 , |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
909 |
0x01f6, ((0x00 << 8) | 0x00), -97 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
910 |
0x01f7, ((0x00 << 8) | 0x00), -56 , |
8010 | 911 |
0x01f8, ((0x26 << 8) | 0x02), 0x0001 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
912 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
913 |
0x0220, ((0x00 << 8) | 0x00), -130 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
914 |
#endif |
8010 | 915 |
0x0222, ((0x10 << 8) | 0x02), 0x0001 , |
916 |
0x0386, ((0x00 << 8) | 0x00), 0x0026 , |
|
917 |
0x0388, ((0x02 << 8) | 0x01), 0x0025 , |
|
918 |
0x038c, ((0x00 << 8) | 0x00), 0x0040 , |
|
919 |
0x038e, ((0x01 << 8) | 0x01), 0x003f , |
|
920 |
0x0391, ((0x10 << 8) | 0x01), 0x0020 , |
|
921 |
0x03a3, ((0x08 << 8) | 0x01), 0x0020 , |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
922 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
923 |
0x03d8, ((0x00 << 8) | 0x00), 1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
924 |
#endif |
8010 | 925 |
0x03da, ((0x14 << 8) | 0x02), 0x0001 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
926 |
0x03f4, ((0x00 << 8) | 0x00), -60 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
927 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
928 |
0x03f7, ((0x03 << 8) | 0x03), 1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
929 |
0x03f9, ((0x00 << 8) | 0x00), -7 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
930 |
#endif |
8010 | 931 |
0x0400, ((0x0f << 8) | 0x01), 0x0050 , |
932 |
0x0410, ((0x1f << 8) | 0x01), 0x0020 , |
|
933 |
0x0460, ((0x20 << 8) | 0x02), 0x0001 , |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
934 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
935 |
0x048a, ((0x00 << 8) | 0x00), 1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
936 |
#endif |
8010 | 937 |
0x048c, ((0x32 << 8) | 0x02), 0x0001 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
938 |
#ifdef UNICODE_3_2 |
8010 | 939 |
0x04c1, ((0x02 << 8) | 0x02), 0x0001 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
940 |
#else |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
941 |
0x04c1, ((0x04 << 8) | 0x02), 0x0001 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
942 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
943 |
#ifdef UNICODE_3_2 |
8010 | 944 |
0x04c7, ((0x04 << 8) | 0x04), 0x0001 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
945 |
#else |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
946 |
0x04c7, ((0x04 << 8) | 0x02), 0x0001 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
947 |
0x04cd, ((0x00 << 8) | 0x00), 0x0001 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
948 |
#endif |
8010 | 949 |
0x04d0, ((0x24 << 8) | 0x02), 0x0001 , |
950 |
0x04f8, ((0x00 << 8) | 0x00), 0x0001 , |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
951 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
952 |
0x0500, ((0x0E << 8) | 0x02), 1 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
953 |
#endif |
8010 | 954 |
0x0531, ((0x25 << 8) | 0x01), 0x0030 , |
955 |
0x1e00, ((0x94 << 8) | 0x02), 0x0001 , |
|
956 |
0x1ea0, ((0x58 << 8) | 0x02), 0x0001 , |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
957 |
0x1f08, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
958 |
0x1f18, ((0x05 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
959 |
0x1f28, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
960 |
0x1f38, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
961 |
0x1f48, ((0x05 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
962 |
0x1f59, ((0x06 << 8) | 0x02), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
963 |
0x1f68, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
964 |
0x1f88, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
965 |
0x1f98, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
966 |
0x1fa8, ((0x07 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
967 |
0x1fb8, ((0x01 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
968 |
0x1fba, ((0x01 << 8) | 0x01), -74 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
969 |
0x1fbc, ((0x00 << 8) | 0x00), -9 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
970 |
0x1fc8, ((0x03 << 8) | 0x01), -86 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
971 |
0x1fcc, ((0x00 << 8) | 0x00), -9 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
972 |
0x1fd8, ((0x01 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
973 |
0x1fda, ((0x01 << 8) | 0x01), -100 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
974 |
0x1fe8, ((0x01 << 8) | 0x01), -8 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
975 |
0x1fea, ((0x01 << 8) | 0x01), -112 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
976 |
0x1fec, ((0x00 << 8) | 0x00), -7 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
977 |
0x1ff8, ((0x01 << 8) | 0x01), -128 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
978 |
0x1ffa, ((0x01 << 8) | 0x01), -126 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
979 |
0x1ffc, ((0x00 << 8) | 0x00), -9 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
980 |
0x2126, ((0x00 << 8) | 0x00), -7517 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
981 |
0x212a, ((0x00 << 8) | 0x00), -8383 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
982 |
0x212b, ((0x00 << 8) | 0x00), -8262 , |
8010 | 983 |
0x2160, ((0x0f << 8) | 0x01), 0x0010 , |
984 |
0x24b6, ((0x19 << 8) | 0x01), 0x001a , |
|
9153 | 985 |
0xff21, ((0x19 << 8) | 0x01), 0x0020 , |
986 |
0x10400, ((0x27 << 8) | 0x01), 0x0028 |
|
8010 | 987 |
}; |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
988 |
|
14684 | 989 |
REGISTER unsigned INT __codePoint; |
8308 | 990 |
REGISTER int * __p; |
8010 | 991 |
|
992 |
__codePoint = __intVal(__INST(asciivalue)); |
|
18691 | 993 |
|
994 |
// comon ascii stuff first |
|
995 |
if (__codePoint < 0x80) { |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
996 |
if ((__codePoint >= 'A') && (__codePoint <= 'Z')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
997 |
unsigned int newCodePoint = __codePoint - 'A' + 'a'; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
998 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
999 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1000 |
RETURN (self); |
18691 | 1001 |
} |
1002 |
||
8106
ee222c1314e6
cannot make pointer arith with a void *
Claus Gittinger <cg@exept.de>
parents:
8100
diff
changeset
|
1003 |
for (__p = __mapping; (char *)__p < ((char *)__mapping) + sizeof(__mapping); __p += 3) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1004 |
unsigned rangeStart, rangeSize, rangeEnd, mod; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1005 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1006 |
rangeStart = (unsigned)__p[0]; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1007 |
if (__codePoint < rangeStart) break; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1008 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1009 |
rangeSize = ((unsigned)__p[1]) >> 8; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1010 |
rangeEnd = rangeStart + rangeSize; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1011 |
if (__codePoint <= rangeEnd) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1012 |
mod = __p[1] & 0xFF; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1013 |
if ((mod == 0) || (((__codePoint - rangeStart) % mod) == 0)) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1014 |
OBJ newChar; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1015 |
unsigned newCodePoint; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1016 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1017 |
newCodePoint = __codePoint + __p[2]; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1018 |
if (newCodePoint <= MAX_IMMEDIATE_CHARACTER) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1019 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1020 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1021 |
newChar = __MKUCHARACTER(newCodePoint) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1022 |
if (newChar == nil) goto allocationError; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1023 |
RETURN (newChar) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1024 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1025 |
} |
8010 | 1026 |
} |
1027 |
RETURN (self); |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1028 |
allocationError: ; |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18215
diff
changeset
|
1029 |
#endif /* ! __SCHTEAM__ */ |
8010 | 1030 |
%}. |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1031 |
^ AllocationFailure raise. |
1491
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
1032 |
|
a42ae3fbb756
fixed asLowercase / asUppercase for national characters
Claus Gittinger <cg@exept.de>
parents:
1295
diff
changeset
|
1033 |
" |
9153 | 1034 |
$A asLowercase |
1035 |
$a asLowercase |
|
1036 |
(Character value:16r01F5) asUppercase asLowercase |
|
1037 |
(Character value:16r0205) asUppercase asLowercase |
|
1038 |
(Character value:16r03B1) asUppercase asLowercase |
|
1039 |
(Character value:16r1E00) asLowercase |
|
1040 |
" |
|
699 | 1041 |
! |
1042 |
||
1043 |
asString |
|
1044 |
"return a string of len 1 with myself as contents" |
|
1045 |
||
1046 |
%{ /* NOCONTEXT */ |
|
1047 |
char buffer[2]; |
|
1048 |
OBJ s; |
|
14684 | 1049 |
unsigned INT val; |
699 | 1050 |
|
15262
5047292c9107
all stx macros begin with double underline (eg. __qClass instead of _qClass)
Claus Gittinger <cg@exept.de>
parents:
14684
diff
changeset
|
1051 |
val = __intVal(__characterVal(self)); |
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
1052 |
if (val <= 0xFF) { |
9153 | 1053 |
buffer[0] = (char) val; |
1054 |
buffer[1] = '\0'; |
|
1055 |
s = __MKSTRING_L(buffer, 1); |
|
1056 |
if (s != nil) { |
|
1057 |
RETURN (s); |
|
1058 |
} |
|
699 | 1059 |
} |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1060 |
if (val <= 0xFFFF) { |
9153 | 1061 |
s = __MKEMPTYU16STRING(1); |
1062 |
if (s != nil) { |
|
1063 |
__Unicode16StringInstPtr(s)->s_element[0] = val; |
|
1064 |
RETURN (s); |
|
1065 |
} |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1066 |
} |
699 | 1067 |
%}. |
7951 | 1068 |
asciivalue > 16rFF ifTrue:[ |
9153 | 1069 |
asciivalue > 16rFFFF ifTrue:[ |
1070 |
^ (Unicode32String new:1) at:1 put:self; yourself |
|
1071 |
]. |
|
1072 |
^ (Unicode16String new:1) at:1 put:self; yourself |
|
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
1073 |
]. |
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
1074 |
|
5407 | 1075 |
^ (String new:1) at:1 put:self; yourself. |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1076 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1077 |
" |
9153 | 1078 |
(Character value:16rB5) asString |
1079 |
(Character value:16r1B5) asString |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1080 |
" |
699 | 1081 |
! |
1082 |
||
1083 |
asSymbol |
|
17184 | 1084 |
"Return a unique symbol with the name taken from the receiver's characters. |
9229 | 1085 |
Here, a single character symbol is returned." |
699 | 1086 |
|
1087 |
^ Symbol internCharacter:self |
|
1088 |
! |
|
1089 |
||
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1090 |
asTitlecase |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1091 |
"return a character with same letter as the receiver, but in titlecase. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1092 |
Returns the receiver if it is already titlecase or if there is no titlecase equivalent." |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1093 |
|
8026 | 1094 |
" |
9153 | 1095 |
For example, in Unicode, character U+01F3 is LATIN SMALL LETTER DZ. |
1096 |
(Let us write this compound character using ASCII as 'dz'.) |
|
1097 |
This character uppercases to character U+01F1, LATIN CAPITAL LETTER DZ. |
|
1098 |
(Which is basically 'DZ'.) |
|
1099 |
But it titlecases to to character U+01F2, LATIN CAPITAL LETTER D WITH SMALL LETTER Z. |
|
8026 | 1100 |
(Which we can write 'Dz'.) |
1101 |
||
1102 |
character uppercase titlecase |
|
1103 |
--------- --------- --------- |
|
1104 |
dz DZ Dz |
|
1105 |
" |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1106 |
|ch| |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1107 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1108 |
%{ |
14684 | 1109 |
static unsigned short __mapping[] = { |
9153 | 1110 |
0x01C4, 0x01C5, |
1111 |
0x01C6, 0x01C5, |
|
1112 |
0x01C7, 0x01C8, |
|
1113 |
0x01C9, 0x01C8, |
|
1114 |
0x01CA, 0x01CB, |
|
1115 |
0x01CC, 0x01CB, |
|
14684 | 1116 |
0x01F1, 0x01F2, |
1117 |
0x01F3, 0x01F2, |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1118 |
}; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1119 |
|
14684 | 1120 |
REGISTER unsigned INT __codePoint; |
8885 | 1121 |
REGISTER unsigned short *__p; |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1122 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1123 |
__codePoint = __intVal(__INST(asciivalue)); |
18691 | 1124 |
if ((__codePoint > 0x01C0) && (__codePoint < 0x01FF)) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1125 |
for (__p = __mapping; (char *)__p < ((char *)__mapping) + sizeof(__mapping); __p += 2) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1126 |
if ((__codePoint == __p[0]) || (__codePoint == __p[1])) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1127 |
short newCodePoint; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1128 |
OBJ newChar; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1129 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1130 |
newCodePoint = __p[1]; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1131 |
if (newCodePoint == __codePoint) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1132 |
RETURN (self); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1133 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1134 |
if (newCodePoint <= MAX_IMMEDIATE_CHARACTER) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1135 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1136 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1137 |
newChar = __MKUCHARACTER(newCodePoint) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1138 |
if (newChar == nil) goto getOutOfHere; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1139 |
RETURN (newChar) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1140 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1141 |
} |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1142 |
} |
18691 | 1143 |
if (__codePoint < 0x80) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1144 |
// do it here for common ascii characters |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1145 |
if ((__codePoint >= 'a') && (__codePoint <= 'z')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1146 |
unsigned char newCodePoint = __codePoint - 'a' + 'A'; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1147 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1148 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1149 |
RETURN (self) ; |
18691 | 1150 |
} |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1151 |
|
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1152 |
ch = self; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1153 |
getOutOfHere: ; |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1154 |
%}. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1155 |
ch notNil ifTrue:[ |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1156 |
^ ch asUppercase. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1157 |
]. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1158 |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1159 |
^ AllocationFailure raise. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1160 |
|
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1161 |
" |
9153 | 1162 |
$A asTitlecase |
1163 |
$a asTitlecase |
|
1164 |
(Character value:16r01F1) asTitlecase |
|
18691 | 1165 |
(Character value:16r01F2) asTitlecase |
9153 | 1166 |
" |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1167 |
! |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1168 |
|
6029 | 1169 |
asUnicodeString |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1170 |
"return a unicode string of len 1 with myself as contents. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1171 |
This will vanish, as we now (rel5.2.x) use Unicode as default." |
6029 | 1172 |
|
7951 | 1173 |
asciivalue > 16rFFFF ifTrue:[ |
9153 | 1174 |
^ (Unicode32String new:1) at:1 put:self; yourself. |
7951 | 1175 |
]. |
1176 |
^ (Unicode16String new:1) at:1 put:self; yourself. |
|
6029 | 1177 |
! |
1178 |
||
699 | 1179 |
asUppercase |
8010 | 1180 |
"return a character with same letter as the receiver, but in uppercase. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1181 |
Returns the receiver if it is already uppercase or if there is no uppercase equivalent. |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1182 |
CAVEAT: |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1183 |
for now, this method is only correct for unicode characters up to u+1d6ff (Unicode3.1). |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1184 |
(which is more than mozilla does, btw. ;-)" |
7990
2f78c1d609c7
asUppercase / asLowercase for UFF00..UFFFF
Claus Gittinger <cg@exept.de>
parents:
7989
diff
changeset
|
1185 |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1186 |
%{ |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18215
diff
changeset
|
1187 |
#ifdef __SCHTEAM__ |
18215 | 1188 |
{ |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1189 |
char ch = self.charValue("[asUppercase]"); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1190 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1191 |
ch = java.lang.Character.toUpperCase(ch); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1192 |
return context._RETURN(STCharacter._new(ch)); |
18215 | 1193 |
} |
1194 |
/* NOTREACHED */ |
|
1195 |
#else |
|
14684 | 1196 |
static int __mapping[] = { |
9153 | 1197 |
/* From To Every Diff */ |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1198 |
0x0061, ((0x19 << 8) | 0x01), -32 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1199 |
0x00b5, ((0x00 << 8) | 0x3b), 0x02e7 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1200 |
0x00e0, ((0x16 << 8) | 0x01), -32 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1201 |
0x00f8, ((0x06 << 8) | 0x01), -32 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1202 |
0x00ff, ((0x00 << 8) | 0x01), 0x0079 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1203 |
0x0101, ((0x2e << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1204 |
0x0131, ((0x00 << 8) | 0x02), -232 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1205 |
0x0133, ((0x04 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1206 |
0x013a, ((0x0e << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1207 |
0x014b, ((0x2c << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1208 |
0x017a, ((0x04 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1209 |
0x017f, ((0x00 << 8) | 0x01), -300 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1210 |
0x0183, ((0x02 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1211 |
0x0188, ((0x04 << 8) | 0x04), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1212 |
0x0192, ((0x00 << 8) | 0x06), -1 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1213 |
0x0195, ((0x00 << 8) | 0x03), 0x0061 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1214 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1215 |
0x0199, ((0x04 << 8) | 0x08), -1 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1216 |
0x019e, ((0x00 << 8) | 0x00), 130 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1217 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1218 |
0x0199, ((0x08 << 8) | 0x08), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1219 |
0x01a3, ((0x02 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1220 |
0x01a8, ((0x05 << 8) | 0x05), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1221 |
0x01b0, ((0x04 << 8) | 0x04), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1222 |
0x01b6, ((0x03 << 8) | 0x03), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1223 |
0x01bd, ((0x00 << 8) | 0x04), -1 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1224 |
0x01bf, ((0x00 << 8) | 0x02), 0x0038 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1225 |
0x01c5, ((0x00 << 8) | 0x06), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1226 |
0x01c6, ((0x00 << 8) | 0x01), -2 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1227 |
0x01c8, ((0x00 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1228 |
0x01c9, ((0x00 << 8) | 0x01), -2 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1229 |
0x01cb, ((0x00 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1230 |
0x01cc, ((0x00 << 8) | 0x01), -2 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1231 |
0x01ce, ((0x0e << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1232 |
0x01dd, ((0x00 << 8) | 0x01), -79 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1233 |
0x01df, ((0x10 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1234 |
0x01f2, ((0x00 << 8) | 0x03), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1235 |
0x01f3, ((0x00 << 8) | 0x01), -2 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1236 |
0x01f5, ((0x04 << 8) | 0x04), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1237 |
0x01fb, ((0x24 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1238 |
0x0223, ((0x10 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1239 |
0x0253, ((0x00 << 8) | 0x20), -210 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1240 |
0x0254, ((0x00 << 8) | 0x01), -206 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1241 |
0x0256, ((0x01 << 8) | 0x01), -205 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1242 |
0x0259, ((0x00 << 8) | 0x02), -202 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1243 |
0x025b, ((0x00 << 8) | 0x02), -203 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1244 |
0x0260, ((0x00 << 8) | 0x05), -205 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1245 |
0x0263, ((0x00 << 8) | 0x03), -207 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1246 |
0x0268, ((0x00 << 8) | 0x05), -209 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1247 |
0x0269, ((0x06 << 8) | 0x06), -211 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1248 |
0x0272, ((0x00 << 8) | 0x03), -213 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1249 |
0x0275, ((0x00 << 8) | 0x03), -214 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1250 |
0x0280, ((0x03 << 8) | 0x03), -218 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1251 |
0x0288, ((0x00 << 8) | 0x05), -218 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1252 |
0x028a, ((0x01 << 8) | 0x01), -217 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1253 |
0x0292, ((0x00 << 8) | 0x07), -219 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1254 |
0x0345, ((0x00 << 8) | 0xb3), 0x0054 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1255 |
0x03ac, ((0x00 << 8) | 0x67), -38 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1256 |
0x03ad, ((0x02 << 8) | 0x01), -37 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1257 |
0x03b1, ((0x10 << 8) | 0x01), -32 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1258 |
0x03c2, ((0x00 << 8) | 0x01), -31 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1259 |
0x03c3, ((0x08 << 8) | 0x01), -32 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1260 |
0x03cc, ((0x00 << 8) | 0x01), -64 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1261 |
0x03cd, ((0x01 << 8) | 0x01), -63 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1262 |
0x03d0, ((0x00 << 8) | 0x02), -62 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1263 |
0x03d1, ((0x00 << 8) | 0x01), -57 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1264 |
0x03d5, ((0x00 << 8) | 0x04), -47 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1265 |
0x03d6, ((0x00 << 8) | 0x01), -54 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1266 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1267 |
0x03d9, ((0x00 << 8) | 0x00), -1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1268 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1269 |
0x03db, ((0x14 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1270 |
0x03f0, ((0x00 << 8) | 0x01), -86 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1271 |
0x03f1, ((0x00 << 8) | 0x01), -80 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1272 |
#ifdef UNICODE_3_2 |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1273 |
0x03f2, ((0x00 << 8) | 0x01), -79 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1274 |
#else |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1275 |
0x03f2, ((0x00 << 8) | 0x00), 7 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1276 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1277 |
0x03f5, ((0x00 << 8) | 0x00), -96 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1278 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1279 |
0x03f8, ((0x03 << 8) | 0x03), -1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1280 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1281 |
0x0430, ((0x1f << 8) | 0x01), -32 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1282 |
0x0450, ((0x0f << 8) | 0x01), -80 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1283 |
0x0461, ((0x20 << 8) | 0x02), -1 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1284 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1285 |
0x048b, ((0x00 << 8) | 0x00), -1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1286 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1287 |
0x048d, ((0x32 << 8) | 0x02), -1 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1288 |
#ifdef UNICODE_3_2 |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1289 |
0x04c2, ((0x02 << 8) | 0x02), -1 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1290 |
#else |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1291 |
0x04c2, ((0x04 << 8) | 0x02), -1 , /* Unicode4.0 - not in X fonts - sigh */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1292 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1293 |
#ifdef UNICODE_3_2 |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1294 |
0x04c8, ((0x04 << 8) | 0x04), -1 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1295 |
#else |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1296 |
0x04c8, ((0x04 << 8) | 0x02), -1 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1297 |
0x04ce, ((0x00 << 8) | 0x00), -1 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1298 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1299 |
0x04d1, ((0x24 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1300 |
0x04f9, ((0x00 << 8) | 0x04), -1 , |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1301 |
#ifndef UNICODE_3_2 |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1302 |
0x0501, ((0x0E << 8) | 0x02), -1 , |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
1303 |
#endif |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1304 |
0x0561, ((0x25 << 8) | 0x01), -48 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1305 |
0x1e01, ((0x94 << 8) | 0x02), -1 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1306 |
0x1e9b, ((0x00 << 8) | 0x06), -59 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1307 |
0x1ea1, ((0x58 << 8) | 0x02), -1 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1308 |
0x1f00, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1309 |
0x1f10, ((0x05 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1310 |
0x1f20, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1311 |
0x1f30, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1312 |
0x1f40, ((0x05 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1313 |
0x1f51, ((0x06 << 8) | 0x02), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1314 |
0x1f60, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1315 |
0x1f70, ((0x01 << 8) | 0x01), 0x004a , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1316 |
0x1f72, ((0x03 << 8) | 0x01), 0x0056 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1317 |
0x1f76, ((0x01 << 8) | 0x01), 0x0064 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1318 |
0x1f78, ((0x01 << 8) | 0x01), 0x0080 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1319 |
0x1f7a, ((0x01 << 8) | 0x01), 0x0070 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1320 |
0x1f7c, ((0x01 << 8) | 0x01), 0x007e , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1321 |
0x1f80, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1322 |
0x1f90, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1323 |
0x1fa0, ((0x07 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1324 |
0x1fb0, ((0x01 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1325 |
0x1fb3, ((0x00 << 8) | 0x02), 0x0009 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1326 |
0x1fbe, ((0x00 << 8) | 0x0b), -7205 , |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1327 |
0x1fc3, ((0x00 << 8) | 0x05), 0x0009 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1328 |
0x1fd0, ((0x01 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1329 |
0x1fe0, ((0x01 << 8) | 0x01), 0x0008 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1330 |
0x1fe5, ((0x00 << 8) | 0x04), 0x0007 , |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1331 |
0x1ff3, ((0x00 << 8) | 0x0e), 0x0009 , |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1332 |
0x2170, ((0x0f << 8) | 0x01), -16 , |
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1333 |
0x24d0, ((0x19 << 8) | 0x01), -26 , |
9153 | 1334 |
0xff41, ((0x19 << 8) | 0x01), -32 , |
1335 |
0x10428, ((0x27 << 8) | 0x01), -40 |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1336 |
}; |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1337 |
|
14684 | 1338 |
REGISTER unsigned INT __codePoint; |
8308 | 1339 |
REGISTER int *__p; |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1340 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1341 |
__codePoint = __intVal(__INST(asciivalue)); |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1342 |
|
18691 | 1343 |
// comon ascii stuff first |
1344 |
if (__codePoint < 0x80) { |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1345 |
if ((__codePoint >= 'a') && (__codePoint <= 'z')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1346 |
unsigned newCodePoint; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1347 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1348 |
newCodePoint = __codePoint - 'a' + 'A'; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1349 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1350 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1351 |
RETURN (self); |
18691 | 1352 |
} |
1353 |
||
8106
ee222c1314e6
cannot make pointer arith with a void *
Claus Gittinger <cg@exept.de>
parents:
8100
diff
changeset
|
1354 |
for (__p = __mapping; (char *)__p < ((char *)__mapping) + sizeof(__mapping); __p += 3) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1355 |
unsigned rangeStart, rangeSize, rangeEnd, mod; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1356 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1357 |
rangeStart = (unsigned)__p[0]; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1358 |
if (rangeStart > __codePoint) break; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1359 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1360 |
rangeSize = ((unsigned)__p[1]) >> 8; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1361 |
rangeEnd = rangeStart + rangeSize; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1362 |
if (__codePoint <= rangeEnd) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1363 |
mod = __p[1] & 0xFF; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1364 |
if ((mod == 0) || (((__codePoint - rangeStart) % mod) == 0)) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1365 |
OBJ newChar; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1366 |
unsigned newCodePoint; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1367 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1368 |
newCodePoint = __codePoint + __p[2]; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1369 |
if (newCodePoint <= MAX_IMMEDIATE_CHARACTER) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1370 |
RETURN (__MKCHARACTER(newCodePoint)) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1371 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1372 |
newChar = __MKUCHARACTER(newCodePoint) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1373 |
if (newChar == nil) goto allocationError; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1374 |
RETURN (newChar) ; |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1375 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1376 |
} |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1377 |
} |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1378 |
RETURN (self); |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
1379 |
allocationError: ; |
18240
28af09029a8b
ifdef for SCHTEAM engine changed (not relevant for ST/X)
Claus Gittinger <cg@exept.de>
parents:
18215
diff
changeset
|
1380 |
#endif /* ! __SCHTEAM__ */ |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1381 |
%}. |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1382 |
^ AllocationFailure raise. |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1383 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1384 |
" |
9153 | 1385 |
$A asLowercase |
1386 |
$a asUppercase |
|
1387 |
(Character value:16r01F5) asUppercase |
|
1388 |
(Character value:16r0205) asUppercase |
|
1389 |
(Character value:16r03B1) asUppercase |
|
1390 |
" |
|
8010 | 1391 |
! |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1392 |
|
8010 | 1393 |
digitValue |
11653 | 1394 |
"return my digitValue for any base (up to 37)" |
8010 | 1395 |
|
8143 | 1396 |
|code "{ Class: SmallInteger }" | |
1397 |
||
1398 |
code := asciivalue. |
|
1399 |
(code between:($0 codePoint) and:($9 codePoint)) ifTrue:[ |
|
14684 | 1400 |
^ code - $0 codePoint |
8010 | 1401 |
]. |
8143 | 1402 |
(code between:($a codePoint) and:($z codePoint)) ifTrue:[ |
14684 | 1403 |
^ code + (10 - $a codePoint) |
9153 | 1404 |
]. |
8143 | 1405 |
(code between:($A codePoint) and:($Z codePoint)) ifTrue:[ |
14684 | 1406 |
^ code + (10 - $A codePoint) |
9153 | 1407 |
]. |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1408 |
|
8010 | 1409 |
"remove error below for X3J20 conformance ... " |
1410 |
self error:'bad character'. |
|
1411 |
" " |
|
1412 |
^ -1 |
|
1413 |
! |
|
1414 |
||
11653 | 1415 |
digitValueRadix:base |
1416 |
"return my digitValue for base. |
|
1417 |
Return nil, if it is not a valid character for that base" |
|
1418 |
||
1419 |
|code "{ Class: SmallInteger }" | |
|
1420 |
||
1421 |
code := asciivalue. |
|
1422 |
base < 10 ifTrue:[ |
|
14684 | 1423 |
(code between:($0 codePoint) and:($0 codePoint + base - 1)) ifTrue:[ |
1424 |
^ code - $0 codePoint |
|
1425 |
]. |
|
1426 |
^ nil. |
|
11653 | 1427 |
]. |
1428 |
(code between:($0 codePoint) and:($9 codePoint)) ifTrue:[ |
|
14684 | 1429 |
^ code - $0 codePoint |
11653 | 1430 |
]. |
1431 |
base <= 10 ifTrue:[ |
|
14684 | 1432 |
^ nil. |
11653 | 1433 |
]. |
1434 |
(code between:($a codePoint) and:($a codePoint + base - 1 - 10)) ifTrue:[ |
|
14684 | 1435 |
^ code + (10 - $a codePoint) |
11653 | 1436 |
]. |
1437 |
(code between:($A codePoint) and:($A codePoint + base - 1 - 10)) ifTrue:[ |
|
14684 | 1438 |
^ code + (10 - $A codePoint) |
11653 | 1439 |
]. |
1440 |
^ nil |
|
1441 |
||
1442 |
" |
|
14684 | 1443 |
self assert:($0 digitValueRadix:10) == 0. |
11653 | 1444 |
self assert:($9 digitValueRadix:10) == 9. |
1445 |
self assert:($a digitValueRadix:10) == nil. |
|
1446 |
self assert:($a digitValueRadix:11) == 10. |
|
1447 |
self assert:($A digitValueRadix:11) == 10. |
|
1448 |
self assert:($a digitValueRadix:16) == 10. |
|
1449 |
self assert:($A digitValueRadix:16) == 10. |
|
1450 |
self assert:($f digitValueRadix:16) == 15. |
|
1451 |
self assert:($F digitValueRadix:16) == 15. |
|
1452 |
self assert:($g digitValueRadix:16) == nil. |
|
1453 |
self assert:($G digitValueRadix:16) == nil. |
|
1454 |
self assert:($g digitValueRadix:17) == 16. |
|
1455 |
self assert:($G digitValueRadix:17) == 16. |
|
1456 |
" |
|
1457 |
! |
|
1458 |
||
8010 | 1459 |
literalArrayEncoding |
1460 |
"encode myself as an array literal, from which a copy of the receiver |
|
1461 |
can be reconstructed with #decodeAsLiteralArray." |
|
1462 |
||
1463 |
^ self |
|
1464 |
||
1465 |
"Created: / 27.10.1997 / 14:40:37 / cg" |
|
1466 |
! |
|
1467 |
||
1468 |
to:aMagnitude |
|
9153 | 1469 |
"Return an Interval over the characters from the receiver to <aMagnitude>. |
8010 | 1470 |
Wrap <aMagnitude> if it is not a legal Character value. (JS)" |
1471 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1472 |
^ Interval from:self to:(aMagnitude \\ 16r3FFFFFFF) |
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1473 |
! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1474 |
|
13499 | 1475 |
to:aMagnitude by:inc |
1476 |
"Return an Interval over the characters from the receiver to <aMagnitude>. |
|
1477 |
Wrap <aMagnitude> if it is not a legal Character value. (JS)" |
|
1478 |
||
1479 |
^ Interval from:self to:(aMagnitude \\ 16r3FFFFFFF) by:inc |
|
1480 |
||
1481 |
"Created: / 04-07-2011 / 19:35:15 / cg" |
|
1482 |
! |
|
1483 |
||
5847 | 1484 |
utf8Encoded |
11321 | 1485 |
"convert a character to its UTF-8 encoding. |
5847 | 1486 |
this returns a String" |
1487 |
||
1488 |
|s| |
|
1489 |
||
7897 | 1490 |
asciivalue <= 16r7F ifTrue:[ |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1491 |
^ self asString. |
7897 | 1492 |
]. |
1493 |
||
8222
f2c454a9a038
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
8207
diff
changeset
|
1494 |
s := WriteStream on:(String new:6). |
11321 | 1495 |
s nextPutUtf8:self. |
5847 | 1496 |
^ s contents |
9153 | 1497 |
|
5847 | 1498 |
" |
23547
c69c97cec351
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
21024
diff
changeset
|
1499 |
'ä' utf8Encoded |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1500 |
'a' utf8Encoded |
5847 | 1501 |
" |
699 | 1502 |
! ! |
1503 |
||
1504 |
!Character methodsFor:'copying'! |
|
1505 |
||
15984 | 1506 |
, aStringOrCharacter |
1507 |
"return a string containing the concatenation of the receiver character |
|
1508 |
and the argument, a string or character. |
|
1509 |
Added for symetry, as we allow string,char also char,string should be allowed" |
|
1510 |
||
16074 | 1511 |
%{ |
1512 |
OBJ s; |
|
1513 |
unsigned INT val; |
|
1514 |
||
1515 |
// fast code for common cases |
|
1516 |
val = __intVal(__characterVal(self)); |
|
1517 |
if (val <= 0xFF) { |
|
18215 | 1518 |
if (__isCharacter(aStringOrCharacter)) { |
1519 |
unsigned INT val2 = __intVal(__characterVal(aStringOrCharacter)); |
|
1520 |
||
1521 |
if (val2 <= 0xFF) { |
|
1522 |
char buffer[2]; |
|
1523 |
||
1524 |
buffer[0] = val; |
|
1525 |
buffer[1] = val2; |
|
1526 |
s = __MKSTRING_L(buffer, 2); |
|
1527 |
if (s != nil) { |
|
1528 |
RETURN (s); |
|
1529 |
} |
|
1530 |
} |
|
1531 |
} else { |
|
1532 |
if (__isString(aStringOrCharacter)) { |
|
1533 |
int strSize = __stringSize(aStringOrCharacter); |
|
1534 |
||
1535 |
s = __MKEMPTYSTRING(strSize+1); |
|
1536 |
if (s != nil) { |
|
1537 |
__StringInstPtr(s)->s_element[0] = val; |
|
1538 |
memcpy(__StringInstPtr(s)->s_element+1, __stringVal(aStringOrCharacter), strSize+1); // copies 0-byte too |
|
1539 |
RETURN (s); |
|
1540 |
} |
|
1541 |
} |
|
1542 |
} |
|
16074 | 1543 |
} |
1544 |
%}. |
|
15984 | 1545 |
^ self asString , aStringOrCharacter |
1546 |
||
1547 |
" |
|
1548 |
$. , $: |
|
1549 |
$. , 'abc' , $. |
|
16074 | 1550 |
|
1551 |
Time millisecondsToRun:[ 10000000 timesRepeat:[ $a , $b ]] |
|
1552 |
Time millisecondsToRun:[ 10000000 timesRepeat:[ $a , 'b' ]] |
|
1553 |
Time millisecondsToRun:[ 10000000 timesRepeat:[ 'a' , 'b' ]] |
|
1554 |
Time millisecondsToRun:[ 10000000 timesRepeat:[ 'a' , $b ]] |
|
15984 | 1555 |
" |
1556 |
! |
|
1557 |
||
699 | 1558 |
copy |
1559 |
"return a copy of myself |
|
1560 |
reimplemented since characters are unique" |
|
1561 |
||
1562 |
^ self |
|
1563 |
! |
|
1564 |
||
10948 | 1565 |
deepCopyUsing:aDictionary postCopySelector:postCopySelector |
699 | 1566 |
"return a deep copy of myself |
4728 | 1567 |
reimplemented since characters are immutable" |
699 | 1568 |
|
1569 |
^ self |
|
1570 |
! |
|
1571 |
||
1572 |
shallowCopy |
|
1573 |
"return a shallow copy of myself |
|
4728 | 1574 |
reimplemented since characters are immutable" |
699 | 1575 |
|
1576 |
^ self |
|
1577 |
! |
|
1578 |
||
1579 |
simpleDeepCopy |
|
1580 |
"return a deep copy of myself |
|
4728 | 1581 |
reimplemented since characters are immutable" |
699 | 1582 |
|
1583 |
^ self |
|
1584 |
! ! |
|
1585 |
||
5471
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1586 |
!Character methodsFor:'encoding'! |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1587 |
|
6508 | 1588 |
rot13 |
9153 | 1589 |
"Usenet: from `rotate alphabet 13 places'] |
6508 | 1590 |
The simple Caesar-cypher encryption that replaces each English |
9153 | 1591 |
letter with the one 13 places forward or back along the alphabet, |
6508 | 1592 |
so that 'The butler did it!!' becomes 'Gur ohgyre qvq vg!!' |
9153 | 1593 |
Most Usenet news reading and posting programs include a rot13 feature. |
6508 | 1594 |
It is used to enclose the text in a sealed wrapper that the reader must choose |
9153 | 1595 |
to open -- e.g., for posting things that might offend some readers, or spoilers. |
6508 | 1596 |
A major advantage of rot13 over rot(N) for other N is that it |
1597 |
is self-inverse, so the same code can be used for encoding and decoding." |
|
1598 |
||
11864 | 1599 |
^ self rot:13 |
6508 | 1600 |
|
1601 |
" |
|
9153 | 1602 |
$h rot13 |
1603 |
$h rot13 rot13 |
|
7715
0e69a830f5d8
use #and: - not #& you lazy bone, you
Claus Gittinger <cg@exept.de>
parents:
7689
diff
changeset
|
1604 |
'The butler did it!!' rot13 -> 'Gur ohgyre qvq vg!!' |
0e69a830f5d8
use #and: - not #& you lazy bone, you
Claus Gittinger <cg@exept.de>
parents:
7689
diff
changeset
|
1605 |
'The butler did it!!' rot13 rot13 -> 'The butler did it!!' |
6508 | 1606 |
" |
11864 | 1607 |
! |
1608 |
||
1609 |
rot:n |
|
1610 |
"Usenet: from `rotate alphabet N places'] |
|
1611 |
The simple Caesar-cypher encryption that replaces each English |
|
1612 |
letter with the one N places forward or back along the alphabet, |
|
1613 |
so that 'The butler did it!!' becomes 'Gur ohgyre qvq vg!!' by rot:13 |
|
1614 |
Most Usenet news reading and posting programs include a rot13 feature. |
|
1615 |
It is used to enclose the text in a sealed wrapper that the reader must choose |
|
1616 |
to open -- e.g., for posting things that might offend some readers, or spoilers. |
|
1617 |
A major advantage of rot13 over rot(N) for other N is that it |
|
1618 |
is self-inverse, so the same code can be used for encoding and decoding." |
|
1619 |
||
1620 |
(self isLetter) ifTrue:[ |
|
14684 | 1621 |
self isLowercase ifTrue:[ |
1622 |
^ 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' at:(self-$a+1+n) |
|
1623 |
]. |
|
1624 |
^ 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ' at:(self-$A+1+n) |
|
11864 | 1625 |
]. |
1626 |
^ self |
|
1627 |
||
1628 |
" |
|
1629 |
'The butler did it!!' rot:13 -> 'Gur ohgyre qvq vg!!' |
|
1630 |
('The butler did it!!' rot:13) rot:13 -> 'The butler did it!!' |
|
1631 |
" |
|
5471
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1632 |
! ! |
a57eeb01c5ab
General encoding method (#encodeOn:with:)
Stefan Vogel <sv@exept.de>
parents:
5452
diff
changeset
|
1633 |
|
10428 | 1634 |
|
8143 | 1635 |
!Character methodsFor:'obsolete'! |
1636 |
||
1637 |
asciiValue |
|
1638 |
"return the asciivalue of myself. |
|
1639 |
The name 'asciiValue' is a historic leftover: |
|
9153 | 1640 |
characters are not limited to 8bit characters. |
8143 | 1641 |
So the actual value returned is a codePoint (i.e. full potential for 31bit encoding). |
1642 |
PP has removed this method with 4.1 and providing asInteger instead. |
|
1643 |
ANSI defines #codePoint, please use this method" |
|
1644 |
||
1645 |
<resource:#obsolete> |
|
1646 |
||
1647 |
^ asciivalue |
|
1648 |
||
1649 |
"Modified: 27.6.1996 / 12:34:34 / cg" |
|
1650 |
! ! |
|
1651 |
||
699 | 1652 |
!Character methodsFor:'printing & storing'! |
1653 |
||
14117 | 1654 |
displayOn:aGCOrStream |
14120
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1655 |
"Compatibility |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1656 |
append a printed desription on some stream (Dolphin, Squeak) |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1657 |
OR: |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1658 |
display the receiver in a graphicsContext at 0@0 (ST80). |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1659 |
This method allows for any object to be displayed in some view |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
1660 |
(although the fallBack is to display its printString ...)" |
699 | 1661 |
|
14117 | 1662 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
1663 |
"/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
|
16744 | 1664 |
(aGCOrStream isStream) ifFalse:[ |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1665 |
^ super displayOn:aGCOrStream |
14117 | 1666 |
]. |
1667 |
||
1668 |
self storeOn:aGCOrStream. |
|
1669 |
aGCOrStream nextPutAll:' "16r'. |
|
1670 |
asciivalue printOn:aGCOrStream base:16. |
|
19195 | 1671 |
aGCOrStream nextPutAll:' '. |
1672 |
asciivalue printOn:aGCOrStream. |
|
14117 | 1673 |
aGCOrStream nextPut:$". |
699 | 1674 |
! |
1675 |
||
1676 |
isLiteral |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1677 |
"return true, if the receiver can be used as a literal constant in ST syntax |
699 | 1678 |
(i.e. can be used in constant arrays)" |
1679 |
||
1680 |
^ true |
|
1681 |
! |
|
1682 |
||
1683 |
||
5746
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1684 |
"print myself on stdout. |
19378 | 1685 |
If Stdout is nil, this method does NOT (by purpose) use the stream classes and |
1686 |
will therefore work even in case of emergency or very early startup (but only, if Stdout is nil)." |
|
699 | 1687 |
|
1688 |
%{ /* NOCONTEXT */ |
|
1689 |
||
5746
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1690 |
if (@global(Stdout) == nil) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1691 |
putchar(__intVal(__INST(asciivalue))); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1692 |
RETURN(self); |
5746
cf5e42cb72ef
do not overwrite the standard printing conventions
Claus Gittinger <cg@exept.de>
parents:
5566
diff
changeset
|
1693 |
} |
5452
71fd110c347a
allow print, printCR during early initialization
Claus Gittinger <cg@exept.de>
parents:
5433
diff
changeset
|
1694 |
%}. |
71fd110c347a
allow print, printCR during early initialization
Claus Gittinger <cg@exept.de>
parents:
5433
diff
changeset
|
1695 |
super print |
699 | 1696 |
! |
1697 |
||
1698 |
printOn:aStream |
|
1699 |
"print myself on aStream" |
|
1700 |
||
1701 |
aStream nextPut:self |
|
1702 |
! |
|
1703 |
||
1704 |
printString |
|
1705 |
"return a string to print me" |
|
1706 |
||
1707 |
^ self asString |
|
1708 |
! |
|
1709 |
||
1710 |
storeOn:aStream |
|
1711 |
"store myself on aStream" |
|
1712 |
||
1713 |
|special| |
|
1714 |
||
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1715 |
(asciivalue between:33 and:127) ifTrue:[ |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1716 |
aStream nextPut:$$; nextPut:self |
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1717 |
] ifFalse:[ |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1718 |
(self == Character space) ifTrue:[ |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1719 |
special := #space |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1720 |
] ifFalse:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1721 |
(self == Character cr) ifTrue:[ |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1722 |
special := #cr. |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1723 |
] ifFalse:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1724 |
(self == Character tab) ifTrue:[ |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1725 |
special := #tab. |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1726 |
] ifFalse:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1727 |
(self == Character esc) ifTrue:[ |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1728 |
special := #esc. |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1729 |
] |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1730 |
] |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1731 |
] |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1732 |
]. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1733 |
special notNil ifTrue:[ |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1734 |
aStream nextPutAll:'(Character '; nextPutAll:special; nextPut:$). |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1735 |
^ self |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1736 |
]. |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1737 |
aStream nextPutAll:'(Character codePoint:16r'. |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1738 |
asciivalue printOn:aStream base:16. |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
1739 |
aStream nextPut:$) |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1740 |
]. |
995
b018368b3a94
asString to 16-bit char should return a twoByteString
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
1741 |
|
3190
81ffb25d1d86
Use #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
3072
diff
changeset
|
1742 |
"Modified: / 23.2.1996 / 23:27:32 / cg" |
81ffb25d1d86
Use #printOn: instead of #printString
Stefan Vogel <sv@exept.de>
parents:
3072
diff
changeset
|
1743 |
"Modified: / 20.1.1998 / 14:10:46 / stefan" |
699 | 1744 |
! ! |
1745 |
||
7257 | 1746 |
!Character methodsFor:'private-accessing'! |
699 | 1747 |
|
8100 | 1748 |
setCodePoint:anInteger |
9153 | 1749 |
"very private - set the codePoint. |
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1750 |
- use this only for newly created characters with codes > MAX_IMMEDIATE_CHARACTER. |
9153 | 1751 |
DANGER alert: |
1752 |
funny things happen, if this is applied to |
|
10936
9381620deb4d
use #codePoint: instead of #value:
Stefan Vogel <sv@exept.de>
parents:
10428
diff
changeset
|
1753 |
one of the shared characters with codePoints 0..MAX_IMMEDIATE_CHARACTER." |
699 | 1754 |
|
1755 |
asciivalue := anInteger |
|
1756 |
! ! |
|
1757 |
||
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1758 |
!Character methodsFor:'queries'! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1759 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1760 |
bitsPerCharacter |
20698 | 1761 |
"return the number of bits I require for storage. |
1762 |
(i.e. am I an Ascii/ISO8859-1 Character or will I need more |
|
1763 |
bits for storage." |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1764 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1765 |
asciivalue <= 16rFF ifTrue:[^ 8]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1766 |
asciivalue <= 16rFFFF ifTrue:[^ 16]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1767 |
^ 32 |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1768 |
! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1769 |
|
19756 | 1770 |
bytesPerCharacter |
1771 |
"return the number of bytes I require for storage" |
|
1772 |
||
1773 |
asciivalue <= 16rFF ifTrue:[^ 1]. |
|
1774 |
asciivalue <= 16rFFFF ifTrue:[^ 2]. |
|
1775 |
^ 4 |
|
1776 |
! |
|
1777 |
||
18595 | 1778 |
characterSize |
18588 | 1779 |
"return the number of bits I require for storage. |
1780 |
Protocol compatibility with CharacterArray." |
|
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
1781 |
|
18595 | 1782 |
asciivalue <= 16r80 ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
1783 |
^ 7 |
18595 | 1784 |
]. |
18588 | 1785 |
asciivalue <= 16rFF ifTrue:[ |
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
1786 |
^ 8 |
18588 | 1787 |
]. |
1788 |
asciivalue <= 16rFFFF ifTrue:[ |
|
18656
fab035561c68
fix: assign instead of compare
Claus Gittinger <cg@exept.de>
parents:
18605
diff
changeset
|
1789 |
^ 16 |
18588 | 1790 |
]. |
1791 |
^ 32 |
|
1792 |
! |
|
1793 |
||
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1794 |
stringSpecies |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1795 |
"return the type of string that is needed to store me" |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1796 |
|
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1797 |
asciivalue <= 16rFF ifTrue:[^ String]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1798 |
asciivalue <= 16rFFFF ifTrue:[^ Unicode16String]. |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1799 |
^ Unicode32String |
20015 | 1800 |
! |
1801 |
||
1802 |
unicodeBlock |
|
20016 | 1803 |
"return the name of the unicode block in which this character is. |
1804 |
incomplete" |
|
20015 | 1805 |
|
1806 |
asciivalue <= 16r007F ifTrue:[^ #BASIC_LATIN ]. |
|
1807 |
asciivalue <= 16r00FF ifTrue:[^ #LATIN1_SUPPLEMENT ]. |
|
1808 |
asciivalue <= 16r017F ifTrue:[^ #LATIN1_EXTENDED_A]. |
|
1809 |
asciivalue <= 16r024F ifTrue:[^ #LATIN1_EXTENDED_B]. |
|
1810 |
asciivalue <= 16r02AF ifTrue:[^ #IPA_EXTENSIONS]. |
|
1811 |
asciivalue <= 16r02FF ifTrue:[^ #SPACING_MODIFIER_LETTERS]. |
|
1812 |
asciivalue <= 16r036f ifTrue:[ ^ #COMBINING_DIACRITICAL_MARKS ]. |
|
1813 |
asciivalue <= 16r03FF ifTrue:[ ^ #GREEK_AND_COPTIC ]. |
|
1814 |
asciivalue <= 16r04FF ifTrue:[ ^ #CYRILLIC ]. |
|
1815 |
asciivalue <= 16r052F ifTrue:[ ^ #CYRILLIC_SUPPLEMENT ]. |
|
1816 |
asciivalue <= 16r058F ifTrue:[ ^ #ARMENIAN ]. |
|
1817 |
asciivalue <= 16r05FF ifTrue:[ ^ #HEBREW ]. |
|
1818 |
asciivalue <= 16r06FF ifTrue:[ ^ #ARABIC ]. |
|
1819 |
asciivalue <= 16r074F ifTrue:[ ^ #SYRIAC ]. |
|
1820 |
asciivalue <= 16r077F ifTrue:[ ^ #ARABIC_SUPPLEMENT ]. |
|
1821 |
asciivalue <= 16r07BF ifTrue:[ ^ #THAANA ]. |
|
1822 |
asciivalue <= 16r07FF ifTrue:[ ^ #NKO ]. |
|
1823 |
asciivalue <= 16r083F ifTrue:[ ^ #SAMARITAN ]. |
|
1824 |
asciivalue <= 16r085F ifTrue:[ ^ #MANDAIC ]. |
|
1825 |
asciivalue <= 16r087F ifTrue:[ ^ nil ]. |
|
1826 |
asciivalue <= 16r08FF ifTrue:[ ^ #ARABIC_EXTENDED_A ]. |
|
1827 |
asciivalue <= 16r097F ifTrue:[ ^ #DEVANAGARI ]. |
|
1828 |
asciivalue <= 16r09FF ifTrue:[ ^ #BENGALI ]. |
|
1829 |
asciivalue <= 16r0A7F ifTrue:[ ^ #GURMUKHI ]. |
|
1830 |
asciivalue <= 16r0AFF ifTrue:[ ^ #GUJARATI ]. |
|
1831 |
asciivalue <= 16r0B7F ifTrue:[ ^ #ORIYA ]. |
|
1832 |
asciivalue <= 16r0BFF ifTrue:[ ^ #TAMIL ]. |
|
1833 |
asciivalue <= 16r0C7F ifTrue:[ ^ #TELUGU ]. |
|
1834 |
asciivalue <= 16r0CFF ifTrue:[ ^ #KANNADA ]. |
|
1835 |
asciivalue <= 16r0D7F ifTrue:[ ^ #MALAYALAM ]. |
|
1836 |
asciivalue <= 16r0DFF ifTrue:[ ^ #SINHALA ]. |
|
1837 |
asciivalue <= 16r0E7F ifTrue:[ ^ #THAI ]. |
|
1838 |
asciivalue <= 16r0EFF ifTrue:[ ^ #LAO ]. |
|
1839 |
asciivalue <= 16r0FFF ifTrue:[ ^ #TIBETAN ]. |
|
1840 |
asciivalue <= 16r109F ifTrue:[ ^ #MYANMAR ]. |
|
1841 |
asciivalue <= 16r10FF ifTrue:[ ^ #GEORGIAN ]. |
|
1842 |
asciivalue <= 16r11FF ifTrue:[ ^ #HANGUL_JAMO ]. |
|
1843 |
asciivalue <= 16r137F ifTrue:[ ^ #ETHIOPIC ]. |
|
1844 |
asciivalue <= 16r139F ifTrue:[ ^ #ETHIOPIC_SUPPLEMENT ]. |
|
1845 |
asciivalue <= 16r13FF ifTrue:[ ^ #CHEROKEE ]. |
|
1846 |
asciivalue <= 16r167F ifTrue:[ ^ #UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS ]. |
|
1847 |
asciivalue < 16r1AB0 ifTrue:[ ^ #OTHER ]. |
|
1848 |
asciivalue <= 16r1AFF ifTrue:[ ^ #COMBINING_DIACRITICAL_MARKS_EXTENDED ]. |
|
1849 |
asciivalue < 16r1DC0 ifTrue:[ ^ #OTHER ]. |
|
1850 |
asciivalue <= 16r1DFF ifTrue:[ ^ #COMBINING_DIACRITICAL_MARKS_SUPPLEMENT ]. |
|
1851 |
asciivalue <= 16r1EFF ifTrue:[ ^ #LATIN_EXTENDED_ADDITIONAL ]. |
|
1852 |
asciivalue <= 16r1FFF ifTrue:[ ^ #GREEK_EXTENDED ]. |
|
1853 |
asciivalue <= 16r206F ifTrue:[ ^ #GENERAL_PUNKTUATION ]. |
|
1854 |
asciivalue <= 16r209F ifTrue:[ ^ #SUPERSCRIPTS_AND_SUBSCRIPTS ]. |
|
1855 |
asciivalue <= 16r20CF ifTrue:[ ^ #CURRENCY_SYMBOLS ]. |
|
1856 |
asciivalue < 16r2190 ifTrue:[ ^ #OTHER ]. |
|
1857 |
asciivalue <= 16r21FF ifTrue:[ ^ #ARROWS ]. |
|
1858 |
asciivalue <= 16r22FF ifTrue:[ ^ #MATHEMATICAL_OPERATORS ]. |
|
1859 |
asciivalue <= 16r23FF ifTrue:[ ^ #MISCELLANEOUS_TECHNICAL ]. |
|
1860 |
asciivalue < 16r2600 ifTrue:[ ^ #OTHER ]. |
|
1861 |
asciivalue <= 16r26FF ifTrue:[ ^ #MISCELLANEOUS_SYMBOLS ]. |
|
1862 |
asciivalue <= 16r27BF ifTrue:[ ^ #DINGBATS ]. |
|
1863 |
asciivalue <= 16r27EF ifTrue:[ ^ #MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A ]. |
|
1864 |
^ #OTHER |
|
1865 |
||
1866 |
" |
|
1867 |
(Character value:16r200) unicodeBlock |
|
1868 |
" |
|
8004
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1869 |
! ! |
a09a6a745e65
asLowercase/asUppercase and friends care for 16-bit chars
Claus Gittinger <cg@exept.de>
parents:
7997
diff
changeset
|
1870 |
|
1 | 1871 |
!Character methodsFor:'testing'! |
1872 |
||
54 | 1873 |
isCharacter |
1874 |
"return true, if the receiver is some kind of character" |
|
1875 |
||
1876 |
^ true |
|
1877 |
! |
|
1878 |
||
3667 | 1879 |
isControlCharacter |
8097 | 1880 |
"return true if I am a control character (i.e. ascii value < 32 or == 16rFF)" |
3667 | 1881 |
|
1882 |
%{ /* NOCONTEXT */ |
|
14684 | 1883 |
REGISTER INT val; |
3667 | 1884 |
|
1885 |
val = __intVal(__INST(asciivalue)); |
|
8097 | 1886 |
if (val < ' ' || val == 0xFF) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
1887 |
RETURN ( true ); |
3667 | 1888 |
} |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1889 |
RETURN (false); |
3667 | 1890 |
%}. |
1891 |
||
1892 |
" |
|
1893 |
(Character value:1) isControlCharacter |
|
1894 |
$a isControlCharacter |
|
1895 |
" |
|
1896 |
! |
|
1897 |
||
1 | 1898 |
isDigit |
1899 |
"return true, if I am a digit (i.e. $0 .. $9)" |
|
1900 |
||
7980 | 1901 |
%{ /* NOCONTEXT */ |
6527 | 1902 |
|
14684 | 1903 |
REGISTER INT val; |
6527 | 1904 |
|
1905 |
val = __intVal(__INST(asciivalue)); |
|
14684 | 1906 |
if ((unsigned INT)(val - '0') <= ('9' - '0')) { |
9153 | 1907 |
RETURN ( true ); |
6527 | 1908 |
} |
1909 |
RETURN ( false ); |
|
1910 |
%}. |
|
8097 | 1911 |
^ asciivalue between:$0 codePoint and:$9 codePoint |
1 | 1912 |
! |
1913 |
||
1914 |
isDigitRadix:r |
|
1915 |
"return true, if I am a digit of a base r number" |
|
1916 |
||
9153 | 1917 |
(asciivalue < $0 codePoint) ifTrue:[^ false]. |
1 | 1918 |
(r > 10) ifTrue:[ |
9153 | 1919 |
(asciivalue <= $9 codePoint) ifTrue:[ |
1920 |
^ true |
|
1921 |
]. |
|
1922 |
((asciivalue - $a codePoint) between:0 and:(r - 11)) ifTrue:[ |
|
1923 |
^ true |
|
1924 |
]. |
|
1925 |
^ (asciivalue - $A codePoint) between:0 and:(r - 11) |
|
1 | 1926 |
]. |
8097 | 1927 |
(asciivalue - $0 codePoint) < r ifTrue:[^ true]. |
1 | 1928 |
^ false |
1929 |
! |
|
1930 |
||
699 | 1931 |
isEndOfLineCharacter |
1932 |
"return true if I am a line delimitting character" |
|
1 | 1933 |
|
1934 |
%{ /* NOCONTEXT */ |
|
1935 |
||
14684 | 1936 |
REGISTER INT val; |
1 | 1937 |
|
1133 | 1938 |
val = __intVal(__INST(asciivalue)); |
699 | 1939 |
if ((val == '\n') |
1940 |
|| (val == '\r') |
|
1941 |
|| (val == '\f')) { |
|
9153 | 1942 |
RETURN ( true ); |
54 | 1943 |
} |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1944 |
RETURN (false); |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1945 |
%}. |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1946 |
^ asciivalue == 16r0A |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1947 |
or:[asciivalue == 16r0D |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1948 |
or:[asciivalue == 16r0C]] |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1949 |
|
1 | 1950 |
! |
1951 |
||
5473
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1952 |
isImmediate |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1953 |
"return true if I am an immediate object |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1954 |
i.e. I am represented in the pointer itself and |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1955 |
no real object header/storage is used me. |
9153 | 1956 |
For VW compatibility, shared characters (i.e. in the range 0..MAX_IMMEDIATE_CHARACTER) |
5473
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1957 |
also return true here" |
9153 | 1958 |
|
8097 | 1959 |
%{ /* NOCONTEXT */ |
1960 |
if (__smallIntegerVal(__INST(asciivalue)) <= MAX_IMMEDIATE_CHARACTER) { |
|
9153 | 1961 |
RETURN ( true ); |
8097 | 1962 |
} |
1963 |
%}. |
|
1964 |
^ false |
|
1965 |
||
1966 |
" |
|
9153 | 1967 |
$a isImmediate. |
1968 |
(Character value:255) isImmediate. |
|
1969 |
(Character value:256) isImmediate. |
|
1970 |
(Character value:1566) isImmediate. |
|
8097 | 1971 |
" |
5473
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1972 |
! |
c48d8c45c740
isImmediate returns true for shared characters
Claus Gittinger <cg@exept.de>
parents:
5471
diff
changeset
|
1973 |
|
1 | 1974 |
isLetter |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
1975 |
"return true, if I am a letter in the 'a'..'z' range. |
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
1976 |
Use isNationalLetter, if you are interested in those." |
1 | 1977 |
|
7980 | 1978 |
%{ /* NOCONTEXT */ |
1 | 1979 |
|
14684 | 1980 |
REGISTER INT val; |
1 | 1981 |
|
1133 | 1982 |
val = __intVal(__INST(asciivalue)); |
14684 | 1983 |
if ((unsigned INT)(val - 'a') <= ('z' - 'a')) { |
9153 | 1984 |
RETURN ( true ); |
6527 | 1985 |
} |
14684 | 1986 |
if ((unsigned INT)(val - 'A') <= ('Z' - 'A')) { |
9153 | 1987 |
RETURN ( true ); |
6527 | 1988 |
} |
1989 |
RETURN ( false ); |
|
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
1990 |
%}. |
8097 | 1991 |
^ (asciivalue between:($a codePoint) and:($z codePoint)) |
1992 |
or:[(asciivalue between:($A codePoint) and:($Z codePoint))] |
|
1 | 1993 |
! |
1994 |
||
154 | 1995 |
isLetterOrDigit |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
1996 |
"return true, if I am a letter (a..z or A..Z) or a digit (0..9) |
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
1997 |
Use isNationalAlphaNumeric, if you are interested in those." |
1 | 1998 |
|
1999 |
%{ /* NOCONTEXT */ |
|
2000 |
||
14684 | 2001 |
REGISTER INT val; |
1 | 2002 |
|
1133 | 2003 |
val = __intVal(__INST(asciivalue)); |
14684 | 2004 |
if ((unsigned INT)(val - 'a') <= ('z' - 'a')) { |
9153 | 2005 |
RETURN ( true ); |
1 | 2006 |
} |
14684 | 2007 |
if ((unsigned INT)(val - 'A') <= ('Z' - 'A')) { |
9153 | 2008 |
RETURN ( true ); |
1 | 2009 |
} |
14684 | 2010 |
if ((unsigned INT)(val - '0') <= ('9' - '0')) { |
9153 | 2011 |
RETURN ( true ); |
1 | 2012 |
} |
2013 |
RETURN ( false ); |
|
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2014 |
%}. |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2015 |
^ self isLetter or:[self isDigit] |
1 | 2016 |
! |
2017 |
||
17440 | 2018 |
isLetterOrUnderline |
2019 |
"return true, if I am a letter or $_" |
|
2020 |
||
2021 |
^ self == $_ or:[ self isLetter ] |
|
2022 |
! |
|
2023 |
||
699 | 2024 |
isLowercase |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2025 |
"return true, if I am a lower-case letter. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2026 |
This one does care for national characters. |
9153 | 2027 |
Caveat: |
14684 | 2028 |
only returns the correct value for codes up to u+1d6ff (Unicode3.1). |
2029 |
(which is more than mozilla does, btw. ;-)" |
|
699 | 2030 |
|
2031 |
%{ /* NOCONTEXT */ |
|
2032 |
||
14684 | 2033 |
REGISTER unsigned INT val; |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2034 |
REGISTER unsigned int lowByte; |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2035 |
#define TRUE_IF_ODD(x) ((x & 1) ? true : false) |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2036 |
#define TRUE_IF_EVEN(x) ((x & 1) ? false : true) |
154 | 2037 |
|
14684 | 2038 |
/* because used so often, this is open coded, instead of table driven */ |
1133 | 2039 |
val = __intVal(__INST(asciivalue)); |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2040 |
lowByte = val & 0xFF; |
14684 | 2041 |
|
2042 |
/* the most likely case here, outside the switch */ |
|
2043 |
if (val <= 0xFF) { |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2044 |
if ((unsigned)(lowByte - 'a') <= ('z' - 'a')) { |
14684 | 2045 |
RETURN ( true ); |
2046 |
} |
|
2047 |
||
2048 |
/* iso8859 puts national lower case characters at e0 .. ff */ |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2049 |
if ((lowByte >= 0xDF) && (lowByte <= 0xFF)) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2050 |
if (lowByte != 0xF7) { |
14684 | 2051 |
RETURN(true); |
2052 |
} |
|
2053 |
} |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2054 |
if (lowByte == 0xAA) RETURN(true); /* FEMININE ORDINAL INDICATOR (high a-underline) */ |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2055 |
if (lowByte == 0xB5) RETURN(true); /* MICRO SIGN */ |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2056 |
if (lowByte == 0xBA) RETURN(true); /* MASCULINE ORDINAL INDICATOR (high o-underline) */ |
14684 | 2057 |
RETURN (false); |
2058 |
} |
|
2059 |
||
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2060 |
switch (val >> 8) { |
14684 | 2061 |
case 0x01: |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2062 |
if (lowByte <= 0x37) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2063 |
if (lowByte <= 0x48) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2064 |
if (lowByte <= 0x78) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2065 |
if (lowByte <= 0x7E) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2066 |
if (lowByte <= 0x80) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2067 |
if (lowByte < 0xCD) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2068 |
if (lowByte == 0x81) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2069 |
if (lowByte <= 0x85) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2070 |
RETURN (TRUE_IF_ODD(lowByte)); |
14684 | 2071 |
} |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2072 |
if (lowByte == 0x88) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2073 |
if (lowByte == 0x8C) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2074 |
if (lowByte == 0x8D) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2075 |
if (lowByte == 0x92) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2076 |
if (lowByte == 0x95) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2077 |
if (lowByte == 0x99) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2078 |
if (lowByte == 0x9A) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2079 |
if (lowByte == 0x9B) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2080 |
if (lowByte == 0x9E) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2081 |
if (lowByte <= 0xA0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2082 |
if (lowByte <= 0xA6) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2083 |
if (lowByte <= 0xAA) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2084 |
if (lowByte <= 0xAE) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2085 |
if (lowByte == 0xB2) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2086 |
if (lowByte <= 0xB6) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2087 |
if (lowByte == 0xB9) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2088 |
if (lowByte == 0xBA) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2089 |
if (lowByte == 0xBD) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2090 |
if (lowByte == 0xBE) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2091 |
if (lowByte == 0xBF) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2092 |
if (lowByte == 0xC6) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2093 |
if (lowByte == 0xC9) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2094 |
if (lowByte == 0xCC) { RETURN (true); } |
14684 | 2095 |
RETURN (false); |
2096 |
} |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2097 |
if (lowByte <= 0xDC) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2098 |
if (lowByte <= 0xEF) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2099 |
if (lowByte == 0xF0) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2100 |
if (lowByte == 0xF1) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2101 |
if (lowByte == 0xF2) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2102 |
if (lowByte == 0xF3) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2103 |
if (lowByte <= 0xF6) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2104 |
if (lowByte == 0xF7) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2105 |
RETURN (TRUE_IF_ODD(lowByte)); |
14684 | 2106 |
|
2107 |
case 0x02: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2108 |
if (lowByte <= 0x33) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2109 |
if (lowByte <= 0x36) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2110 |
if (lowByte < 0x50) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2111 |
if (lowByte < 0xB0) { RETURN (true); } |
14684 | 2112 |
RETURN (false); |
2113 |
||
2114 |
||
2115 |
case 0x03: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2116 |
if (lowByte == 0x90) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2117 |
if (lowByte <= 0xAB) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2118 |
if (lowByte <= 0xD1) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2119 |
if (lowByte == 0xD5) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2120 |
if (lowByte == 0xD6) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2121 |
if (lowByte < 0xD7) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2122 |
if (lowByte <= 0xEF) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2123 |
if (lowByte <= 0xF3) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2124 |
if (lowByte == 0xF5) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2125 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2126 |
if (lowByte == 0xF8) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2127 |
if (lowByte == 0xFB) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2128 |
#endif |
14684 | 2129 |
RETURN (false); |
2130 |
||
2131 |
case 0x04: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2132 |
if (lowByte <= 0x2F) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2133 |
if (lowByte <= 0x5F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2134 |
if (lowByte <= 0x81) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2135 |
if (lowByte < 0x8A) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2136 |
if (lowByte <= 0xC0) { RETURN (TRUE_IF_ODD(lowByte)); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2137 |
#ifdef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2138 |
if (lowByte == 0xC5) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2139 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2140 |
#ifdef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2141 |
if (lowByte <= 0xC8) { RETURN (TRUE_IF_EVEN(lowByte)); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2142 |
#else |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2143 |
if (lowByte <= 0xCA) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2144 |
if (lowByte == 0xCD) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2145 |
if (lowByte == 0xCE) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2146 |
#endif |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2147 |
if (lowByte == 0xCB) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2148 |
if (lowByte == 0xCC) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2149 |
RETURN (TRUE_IF_ODD(lowByte)); |
14684 | 2150 |
|
2151 |
case 0x05: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2152 |
if (lowByte <= 0x0F) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2153 |
if (lowByte < 0x61) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2154 |
if (lowByte <= 0x87) { RETURN (true); } |
14684 | 2155 |
RETURN (false); |
2156 |
||
2157 |
case 0x1D: |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2158 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2159 |
if (lowByte <= 0x2B) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2160 |
if (lowByte <= 0x61) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2161 |
if (lowByte <= 0x70) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2162 |
#endif |
14684 | 2163 |
RETURN (false); |
2164 |
||
2165 |
case 0x1E: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2166 |
if (lowByte < 0x96) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2167 |
if (lowByte <= 0x9F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2168 |
RETURN (TRUE_IF_ODD(lowByte)); |
14684 | 2169 |
|
2170 |
case 0x1F: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2171 |
if (lowByte <= 0x6F) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2172 |
if (lowByte & 0x0008) { RETURN (false); } |
14684 | 2173 |
RETURN (true); |
2174 |
} |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2175 |
if (lowByte <= 0x87) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2176 |
if (lowByte < 0xB8) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2177 |
if (lowByte & 0x0008) { RETURN (false); } |
14684 | 2178 |
RETURN (true); |
2179 |
} |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2180 |
if (lowByte == 0xBE) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2181 |
if (lowByte == 0xD4) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2182 |
if (lowByte == 0xC5) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2183 |
if (lowByte == 0xD5) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2184 |
if (lowByte == 0xC1) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2185 |
if (lowByte == 0xF1) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2186 |
if (lowByte == 0xC0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2187 |
if (lowByte == 0xF0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2188 |
if (((lowByte & 0x000F) >= 0x0000) && ((lowByte & 0x000F) <= 0x0007)) { RETURN (true); } |
14684 | 2189 |
RETURN (false); |
2190 |
||
2191 |
case 0x20: |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2192 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2193 |
if (lowByte == 0x71) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2194 |
#endif |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2195 |
if (lowByte == 0x7F) { RETURN (true); } |
14684 | 2196 |
RETURN (false); |
2197 |
||
2198 |
case 0x21: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2199 |
if (lowByte == 0x0A) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2200 |
if (lowByte < 0x0E) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2201 |
if (lowByte <= 0x0F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2202 |
if (lowByte == 0x13) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2203 |
if (lowByte == 0x2F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2204 |
if (lowByte == 0x34) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2205 |
if (lowByte == 0x39) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2206 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2207 |
if (lowByte == 0x3D) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2208 |
if (lowByte <= 0x45) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2209 |
if (lowByte <= 0x49) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2210 |
#endif |
14684 | 2211 |
RETURN (false); |
2212 |
||
2213 |
case 0xFB: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2214 |
if (lowByte <= 0x1C) { RETURN (true); } |
14684 | 2215 |
RETURN (false); |
2216 |
||
2217 |
case 0xFF: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2218 |
if ((lowByte >= 0x41) && (lowByte <= 0x5A)) { RETURN (true); } |
14684 | 2219 |
RETURN (false); |
2220 |
||
2221 |
case 0x104: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2222 |
if (lowByte <= 0x27) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2223 |
if (lowByte <= 0x4D) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2224 |
#ifdef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2225 |
if (lowByte <= 0x4D) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2226 |
#else |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2227 |
if (lowByte <= 0x4F) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2228 |
#endif |
14684 | 2229 |
RETURN (false); |
2230 |
||
2231 |
case 0x1D4: |
|
2232 |
case 0x1D5: |
|
2233 |
case 0x1D6: |
|
2234 |
if (val <= 0x1D419) { RETURN (false); } |
|
2235 |
if (val < 0x1D6be) { |
|
2236 |
if (((val - 0x1D41A) % 52) <= 25) { RETURN (true); } |
|
2237 |
RETURN (false); |
|
2238 |
} |
|
2239 |
if (val < 0x1D6c2) { RETURN (false); } |
|
2240 |
if (val < 0x1D6db) { RETURN (true); } |
|
2241 |
if (val == 0x1D6db) { RETURN (false); } |
|
2242 |
if (val < 0x1D6e2) { RETURN (true); } |
|
2243 |
if (val <= 0x1D6fb) { RETURN (false); } |
|
2244 |
RETURN (true); |
|
13558 | 2245 |
|
2246 |
#ifdef UNICODE_4 |
|
14684 | 2247 |
case 0x1D7: |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2248 |
if (lowByte <= 0x1b) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2249 |
if (lowByte <= 0x35) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2250 |
if (lowByte <= 0x55) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2251 |
if (lowByte <= 0x6f) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2252 |
if (lowByte <= 0x8F) { RETURN (true); } |
14684 | 2253 |
|
2254 |
RETURN (false); |
|
13558 | 2255 |
#endif |
699 | 2256 |
} |
7989
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2257 |
#undef TRUE_IF_ODD |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2258 |
#undef TRUE_IF_EVEN |
7907420b2fab
asUppercase / asLowercase for U0100..U04FF
Claus Gittinger <cg@exept.de>
parents:
7988
diff
changeset
|
2259 |
RETURN (false); |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2260 |
%}. |
13558 | 2261 |
|
2262 |
"Modified: / 05-08-2011 / 18:56:33 / cg" |
|
154 | 2263 |
! |
2264 |
||
699 | 2265 |
isPrintable |
2266 |
"return true, if the receiver is a useful printable character |
|
19810 | 2267 |
(see fileBrowser's showFile:-method on how it can be used)" |
1 | 2268 |
|
699 | 2269 |
(asciivalue between:32 and:127) ifTrue:[^ true]. |
6398 | 2270 |
asciivalue == 12 ifTrue:[^ true]. "/ FF |
2271 |
asciivalue == 13 ifTrue:[^ true]. "/ CR |
|
2272 |
asciivalue == 9 ifTrue:[^ true]. "/ TAB |
|
2273 |
asciivalue == 10 ifTrue:[^ true]. "/ NL |
|
2840 | 2274 |
|
8097 | 2275 |
(asciivalue between:16rA0 and:16rBF) ifTrue:[^ true]. "/ ISO-8859 |
2276 |
^ self isNationalAlphaNumeric |
|
2840 | 2277 |
|
2278 |
"Modified: 7.8.1997 / 17:05:24 / cg" |
|
1 | 2279 |
! |
2280 |
||
2281 |
isSeparator |
|
2282 |
"return true if I am a space, cr, tab, nl, or newPage" |
|
2283 |
||
2284 |
%{ /* NOCONTEXT */ |
|
2285 |
||
14684 | 2286 |
REGISTER INT val; |
1 | 2287 |
|
1133 | 2288 |
val = __intVal(__INST(asciivalue)); |
328 | 2289 |
if (val <= ' ') |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2290 |
if ((val == ' ') |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2291 |
|| (val == '\n') |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2292 |
|| (val == '\t') |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2293 |
|| (val == '\r') |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2294 |
|| (val == '\f')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2295 |
RETURN ( true ); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2296 |
} |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2297 |
RETURN (false); |
9153 | 2298 |
%}. |
5423
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2299 |
^ (asciivalue == 16r20) |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2300 |
or:[asciivalue == 16r0D |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2301 |
or:[asciivalue == 16r0A |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2302 |
or:[asciivalue == 16r09 |
e33decc83182
non-primitive fallBack code added
Claus Gittinger <cg@exept.de>
parents:
5407
diff
changeset
|
2303 |
or:[asciivalue == 16r0C]]]] |
1 | 2304 |
! |
2305 |
||
699 | 2306 |
isUppercase |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2307 |
"return true, if I am an upper-case letter. |
8022
d901d41171a5
isXXX and asXXX are now valid up to U+1d6FF
Claus Gittinger <cg@exept.de>
parents:
8012
diff
changeset
|
2308 |
This one does care for national characters. |
9153 | 2309 |
Caveat: |
2310 |
only returns the correct value for codes up to u+1d6ff (Unicode3.1). |
|
2311 |
(which is more than mozilla does, btw. ;-)" |
|
1 | 2312 |
|
2313 |
%{ /* NOCONTEXT */ |
|
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2314 |
#define TRUE_IF_ODD(x) ((x & 1) ? true : false) |
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2315 |
#define TRUE_IF_EVEN(x) ((x & 1) ? false : true) |
1 | 2316 |
|
14684 | 2317 |
/* because used so often, this is open coded, instead of table driven */ |
2318 |
REGISTER unsigned INT val; |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2319 |
REGISTER int lowByte; |
1 | 2320 |
|
1133 | 2321 |
val = __intVal(__INST(asciivalue)); |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2322 |
lowByte = val & 0xFF; |
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2323 |
|
14684 | 2324 |
/* the most likely case here, outside the switch */ |
2325 |
if (val <= 0xFF) { |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2326 |
if ((unsigned int)(lowByte - 'A') <= ('Z' - 'A')) { |
14684 | 2327 |
RETURN ( true ); |
2328 |
} |
|
2329 |
/* iso8859 puts national upper case characters at c0 .. df */ |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2330 |
if ((lowByte >= 0xC0) && (lowByte <= 0xDE)) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2331 |
if (lowByte != 0xD7) { |
14684 | 2332 |
RETURN(true); |
2333 |
} |
|
2334 |
} |
|
2335 |
RETURN (false); |
|
2336 |
} |
|
2337 |
||
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2338 |
switch (val >> 8) { |
9153 | 2339 |
case 0x01: |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2340 |
if (lowByte <= 0x37) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2341 |
if (lowByte <= 0x48) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2342 |
if (lowByte <= 0x78) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2343 |
if (lowByte <= 0x7E) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2344 |
if (lowByte < 0xCD) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2345 |
if (lowByte == 0x80) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2346 |
if (lowByte == 0x81) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2347 |
if (lowByte <= 0x86) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2348 |
RETURN (TRUE_IF_EVEN(lowByte)); |
9153 | 2349 |
} |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2350 |
if (lowByte <= 0x89) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2351 |
RETURN (TRUE_IF_ODD(lowByte)); |
9153 | 2352 |
} |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2353 |
if (lowByte <= 0x8B) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2354 |
if (lowByte <= 0x8D) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2355 |
if (lowByte <= 0x91) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2356 |
if (lowByte == 0x93) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2357 |
if (lowByte == 0x94) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2358 |
if (lowByte == 0x96) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2359 |
if (lowByte == 0x97) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2360 |
if (lowByte == 0x98) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2361 |
if (lowByte == 0x9C) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2362 |
if (lowByte == 0x9D) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2363 |
if (lowByte == 0x9F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2364 |
if (lowByte < 0xA0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2365 |
if (lowByte <= 0xA6) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2366 |
if (lowByte <= 0xAA) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2367 |
if (lowByte <= 0xAE) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2368 |
if (lowByte == 0xB2) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2369 |
if (lowByte <= 0xB7) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2370 |
if (lowByte == 0xB8) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2371 |
if (lowByte == 0xBC) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2372 |
if (lowByte == 0xC4) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2373 |
if (lowByte == 0xC7) { RETURN (true); } |
8308 | 2374 |
#if 0 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2375 |
if (lowByte == 0xC8) { RETURN (true); } |
8308 | 2376 |
#endif |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2377 |
if (lowByte == 0xCA) { RETURN (true); } |
8308 | 2378 |
#if 0 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2379 |
if (lowByte == 0xCB) { RETURN (true); } |
8308 | 2380 |
#endif |
9153 | 2381 |
RETURN (false); /* WRONG !!! */ |
2382 |
} |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2383 |
if (lowByte <= 0xDC) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2384 |
if (lowByte <= 0xEF) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2385 |
if (lowByte == 0xF0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2386 |
if (lowByte == 0xF1) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2387 |
if (lowByte == 0xF2) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2388 |
if (lowByte == 0xF3) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2389 |
if (lowByte == 0xF4) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2390 |
if (lowByte == 0xF5) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2391 |
if (lowByte == 0xF6) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2392 |
if (lowByte == 0xF7) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2393 |
RETURN (TRUE_IF_EVEN(lowByte)); |
9153 | 2394 |
|
2395 |
case 0x02: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2396 |
if (lowByte <= 0x33) { RETURN (TRUE_IF_EVEN(lowByte)); } |
9153 | 2397 |
RETURN (false); |
2398 |
||
2399 |
case 0x03: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2400 |
if (lowByte < 0x86) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2401 |
if (lowByte == 0x87) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2402 |
if (lowByte == 0x90) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2403 |
if (lowByte <= 0xAB) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2404 |
if (lowByte <= 0xD1) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2405 |
if (lowByte <= 0xD4) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2406 |
if (lowByte <= 0xD7) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2407 |
if (lowByte <= 0xEF) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2408 |
if (lowByte == 0xF4) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2409 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2410 |
if (lowByte == 0xF7) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2411 |
if (lowByte == 0xF9) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2412 |
if (lowByte == 0xFa) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2413 |
#endif |
9153 | 2414 |
RETURN (false); |
2415 |
||
2416 |
case 0x04: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2417 |
if (lowByte <= 0x2F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2418 |
if (lowByte <= 0x5F) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2419 |
if (lowByte <= 0x81) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2420 |
if (lowByte < 0x8A) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2421 |
if (lowByte <= 0xC0) { RETURN (TRUE_IF_EVEN(lowByte)); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2422 |
#ifdef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2423 |
if (lowByte == 0xC5) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2424 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2425 |
#ifdef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2426 |
if (lowByte <= 0xC8) { RETURN (TRUE_IF_ODD(lowByte)); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2427 |
#else |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2428 |
if (lowByte <= 0xCA) { RETURN (TRUE_IF_ODD(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2429 |
if (lowByte == 0xCD) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2430 |
if (lowByte == 0xCE) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2431 |
#endif |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2432 |
if (lowByte == 0xCB) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2433 |
if (lowByte == 0xCC) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2434 |
RETURN (TRUE_IF_EVEN(lowByte)); |
9153 | 2435 |
|
2436 |
case 0x05: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2437 |
if (lowByte <= 0x0F) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2438 |
if (lowByte < 0x31) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2439 |
if (lowByte <= 0x56) { RETURN (true); } |
9153 | 2440 |
RETURN (false); |
2441 |
||
2442 |
case 0x10: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2443 |
if (lowByte < 0xA0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2444 |
if (lowByte <= 0xCF) { RETURN (true); } |
9153 | 2445 |
RETURN (false); |
2446 |
||
2447 |
case 0x1E: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2448 |
if (lowByte < 0x96) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2449 |
if (lowByte < 0xA0) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2450 |
RETURN (TRUE_IF_EVEN(lowByte)); |
9153 | 2451 |
|
2452 |
case 0x1F: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2453 |
if (lowByte <= 0x6F) { |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2454 |
if (lowByte & 0x0008) { RETURN (true); } |
9153 | 2455 |
} |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2456 |
if (lowByte <= 0x87) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2457 |
if (lowByte < 0xB8) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2458 |
if (lowByte < 0xBC) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2459 |
if (lowByte == 0xEC) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2460 |
if (((lowByte & 0x000F) >= 0x0008) && ((lowByte & 0x000F) <= 0x000B)) { RETURN (true); } |
9153 | 2461 |
RETURN (false); |
2462 |
||
2463 |
case 0x21: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2464 |
if (lowByte == 0x02) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2465 |
if (lowByte == 0x07) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2466 |
if (lowByte < 0x0B) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2467 |
if (lowByte < 0x0E) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2468 |
if (lowByte == 0x10) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2469 |
if (lowByte == 0x11) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2470 |
if (lowByte == 0x12) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2471 |
if (lowByte == 0x15) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2472 |
if (lowByte == 0x19) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2473 |
if (lowByte == 0x1A) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2474 |
if (lowByte == 0x1B) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2475 |
if (lowByte == 0x1C) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2476 |
if (lowByte == 0x1D) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2477 |
if (lowByte < 0x24) { RETURN (false); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2478 |
if (lowByte <= 0x2A) { RETURN (TRUE_IF_EVEN(lowByte)); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2479 |
if (lowByte == 0x2B) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2480 |
if (lowByte == 0x2C) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2481 |
if (lowByte == 0x2D) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2482 |
if (lowByte == 0x30) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2483 |
if (lowByte == 0x31) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2484 |
if (lowByte == 0x33) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2485 |
#ifndef UNICODE_3_2 |
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2486 |
if (lowByte == 0x3E) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2487 |
if (lowByte == 0x3F) { RETURN (true); } |
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2488 |
if (lowByte == 0x45) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2489 |
#endif |
9153 | 2490 |
RETURN (false); |
2491 |
||
2492 |
case 0xFF: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2493 |
if ((lowByte >= 0x21) && (lowByte <= 0x3A)) { RETURN (true); } |
9153 | 2494 |
RETURN (false); |
2495 |
||
2496 |
case 0x104: |
|
18658
d1665870d020
better code for asLowercase and asUppercase
Claus Gittinger <cg@exept.de>
parents:
18656
diff
changeset
|
2497 |
if (lowByte <= 0x27) { RETURN (true); } |
9153 | 2498 |
RETURN (false); |
2499 |
||
2500 |
case 0x1D4: |
|
2501 |
case 0x1D5: |
|
2502 |
case 0x1D6: |
|
2503 |
if (val <= 0x1D419) { RETURN (true); } |
|
2504 |
if (val < 0x1D6be) { |
|
2505 |
if (((val - 0x1D41A) % 52) <= 25) { RETURN (false); } |
|
2506 |
RETURN (true); |
|
2507 |
} |
|
2508 |
if (val < 0x1D6c1) { RETURN (true); } |
|
2509 |
if (val < 0x1D6e2) { RETURN (false); } |
|
2510 |
if (val < 0x1D6fb) { RETURN (true); } |
|
2511 |
||
2512 |
RETURN (false); |
|
7979
7515722ccfb1
isUppercase / isLowercase fix for division character.
Claus Gittinger <cg@exept.de>
parents:
7976
diff
changeset
|
2513 |
} |
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2514 |
RETURN (false); |
7985 | 2515 |
|
9153 | 2516 |
#undef TRUE_IF_ODD |
2517 |
#undef TRUE_IF_EVEN |
|
7988
cb1c920e67eb
isUppercase / isLowercase unicode changes
Claus Gittinger <cg@exept.de>
parents:
7987
diff
changeset
|
2518 |
%} |
1 | 2519 |
! |
2520 |
||
699 | 2521 |
isVowel |
2522 |
"return true, if I am a vowel (lower- or uppercase)" |
|
333 | 2523 |
|
6066 | 2524 |
"/ I know the code is ugly; |
2525 |
"/ better code is: |
|
2526 |
"/ 'aeiou' includes:self asLowercase |
|
2527 |
"/ or: |
|
2528 |
"/ 'aeiouAEIOU' includes:self |
|
2529 |
"/ |
|
2530 |
"/ until I have a smart compiler, I use the shorter (codewise): |
|
2531 |
||
699 | 2532 |
(self == $a) ifTrue:[^ true]. |
2533 |
(self == $e) ifTrue:[^ true]. |
|
2534 |
(self == $i) ifTrue:[^ true]. |
|
2535 |
(self == $o) ifTrue:[^ true]. |
|
2536 |
(self == $u) ifTrue:[^ true]. |
|
2537 |
(self == $A) ifTrue:[^ true]. |
|
2538 |
(self == $E) ifTrue:[^ true]. |
|
2539 |
(self == $I) ifTrue:[^ true]. |
|
2540 |
(self == $O) ifTrue:[^ true]. |
|
2541 |
(self == $U) ifTrue:[^ true]. |
|
2542 |
^ false |
|
1 | 2543 |
! ! |
699 | 2544 |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2545 |
!Character methodsFor:'testing - national'! |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2546 |
|
17188 | 2547 |
asNonDiacritical |
2548 |
"return a new character which represents the receiver without diacritics. |
|
2549 |
This is used with string search and when lists are to be ordered/sorted by base character order. |
|
2550 |
CAVEAT: |
|
18215 | 2551 |
for now, this method is only correct for unicode characters up to u+2FF, |
2552 |
i.e. latin languages" |
|
17188 | 2553 |
|
2554 |
%{ /* NOCONTEXT */ |
|
2555 |
||
2556 |
REGISTER INT val; |
|
2557 |
||
2558 |
/* because used so often, this is open coded, instead of table driven */ |
|
2559 |
val = __intVal(__INST(asciivalue)); |
|
2560 |
switch (val >> 8) { |
|
18215 | 2561 |
case 0x00: |
2562 |
if (val < 0xC0) { RETURN(self); } |
|
2563 |
if (val <= 0xC6) { val = 'A'; break; } |
|
2564 |
if (val == 0xC7) { val = 'C'; break; } |
|
2565 |
if (val <= 0xCB) { val = 'E'; break; } |
|
2566 |
if (val <= 0xCF) { val = 'I'; break; } |
|
2567 |
if (val == 0xD0) { val = 'D'; break; } |
|
2568 |
if (val == 0xD1) { val = 'N'; break; } |
|
2569 |
if (val <= 0xD6) { val = 'O'; break; } |
|
2570 |
if (val == 0xD7) { RETURN(self) } |
|
2571 |
if (val == 0xD8) { val = 'O'; break; } |
|
2572 |
if (val <= 0xDC) { val = 'U'; break; } |
|
2573 |
if (val == 0xDD) { val = 'Y'; break; } |
|
2574 |
||
2575 |
if (val < 0xE0) { RETURN(self) } |
|
2576 |
if (val <= 0xE6) { val = 'a'; break; } |
|
2577 |
if (val == 0xE7) { val = 'c'; break; } |
|
2578 |
if (val <= 0xEB) { val = 'e'; break; } |
|
2579 |
if (val <= 0xEF) { val = 'i'; break; } |
|
2580 |
if (val == 0xF0) { val = 'd'; break; } |
|
2581 |
if (val == 0xF1) { val = 'n'; break; } |
|
2582 |
if (val <= 0xF6) { val = 'o'; break; } |
|
2583 |
if (val == 0xF7) { RETURN(self) } |
|
2584 |
if (val == 0xF8) { val = 'o'; break; } |
|
2585 |
if (val <= 0xFC) { val = 'u'; break; } |
|
2586 |
if (val == 0xFD) { val = 'y'; break; } |
|
2587 |
if (val == 0xFF) { val = 'y'; break; } |
|
2588 |
RETURN (self); |
|
2589 |
||
2590 |
case 0x01: |
|
2591 |
if (val <= 0x105) { val = (val & 1) ? 'a' : 'A'; break; } |
|
2592 |
if (val <= 0x10D) { val = (val & 1) ? 'c' : 'C'; break; } |
|
2593 |
if (val <= 0x111) { val = (val & 1) ? 'd' : 'D'; break; } |
|
2594 |
if (val <= 0x11B) { val = (val & 1) ? 'e' : 'E'; break; } |
|
2595 |
if (val <= 0x123) { val = (val & 1) ? 'g' : 'G'; break; } |
|
2596 |
if (val <= 0x127) { val = (val & 1) ? 'h' : 'H'; break; } |
|
2597 |
if (val <= 0x133) { val = (val & 1) ? 'i' : 'I'; break; } |
|
2598 |
if (val <= 0x137) { val = (val & 1) ? 'k' : 'K'; break; } |
|
2599 |
if (val == 0x138) { val = 'K'; break; } |
|
2600 |
if (val <= 0x142) { val = (val & 1) ? 'L' : 'l'; break; } |
|
2601 |
if (val <= 0x148) { val = (val & 1) ? 'N' : 'n'; break; } |
|
2602 |
if (val <= 0x14B) { val = (val & 1) ? 'n' : 'N'; break; } |
|
2603 |
if (val <= 0x153) { val = (val & 1) ? 'o' : 'O'; break; } |
|
2604 |
if (val <= 0x159) { val = (val & 1) ? 'r' : 'R'; break; } |
|
2605 |
if (val <= 0x161) { val = (val & 1) ? 's' : 'S'; break; } |
|
2606 |
if (val <= 0x167) { val = (val & 1) ? 't' : 'T'; break; } |
|
2607 |
if (val <= 0x173) { val = (val & 1) ? 'u' : 'U'; break; } |
|
2608 |
if (val <= 0x175) { val = (val & 1) ? 'w' : 'W'; break; } |
|
2609 |
if (val <= 0x178) { val = (val & 1) ? 'y' : 'Y'; break; } |
|
2610 |
if (val <= 0x17E) { val = (val & 1) ? 'Z' : 'z'; break; } |
|
2611 |
RETURN (self); |
|
2612 |
||
2613 |
case 0x02: |
|
2614 |
if (val <= 0x203) { val = (val & 1) ? 'a' : 'A'; break; } |
|
2615 |
if (val <= 0x207) { val = (val & 1) ? 'e' : 'E'; break; } |
|
2616 |
if (val <= 0x20B) { val = (val & 1) ? 'i' : 'I'; break; } |
|
2617 |
if (val <= 0x20F) { val = (val & 1) ? 'o' : 'O'; break; } |
|
2618 |
if (val <= 0x213) { val = (val & 1) ? 'r' : 'R'; break; } |
|
2619 |
if (val <= 0x217) { val = (val & 1) ? 'u' : 'U'; break; } |
|
2620 |
if (val <= 0x219) { val = (val & 1) ? 's' : 'S'; break; } |
|
2621 |
if (val <= 0x21B) { val = (val & 1) ? 't' : 'T'; break; } |
|
2622 |
RETURN (self); |
|
2623 |
||
2624 |
case 0x03: |
|
2625 |
// to be done |
|
2626 |
RETURN (self); |
|
2627 |
||
2628 |
case 0x04: |
|
2629 |
// to be done |
|
2630 |
RETURN (self); |
|
17188 | 2631 |
} |
2632 |
if (val <= MAX_IMMEDIATE_CHARACTER) { |
|
18215 | 2633 |
RETURN (__MKCHARACTER(val)) ; |
17188 | 2634 |
} |
2635 |
RETURN (__MKUCHARACTER(val)) ; |
|
2636 |
%} |
|
2637 |
||
2638 |
" |
|
2639 |
$e asNonDiacritical |
|
23547
c69c97cec351
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
21024
diff
changeset
|
2640 |
$é asNonDiacritical |
c69c97cec351
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
21024
diff
changeset
|
2641 |
$ä asNonDiacritical |
c69c97cec351
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
21024
diff
changeset
|
2642 |
$ĺ asNonDiacritical |
17188 | 2643 |
" |
2644 |
! |
|
2645 |
||
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2646 |
isNationalAlphaNumeric |
18268 | 2647 |
"return true, if the receiver is a letter or digit. |
2648 |
This assumes unicode encoding." |
|
2649 |
||
2650 |
^ self isNationalLetter or:[self isNationalDigit] |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2651 |
! |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2652 |
|
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2653 |
isNationalDigit |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2654 |
"return true, if the receiver is a digit. |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2655 |
This assumes unicode encoding. |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2656 |
WARNING: this method is not complete." |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2657 |
|
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2658 |
|codePoint "{ Class SmallInteger }"| |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2659 |
|
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2660 |
codePoint := asciivalue. |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2661 |
|
9153 | 2662 |
codePoint <= 16rFF ifTrue:[ "/ u00xx - unicode latin1 page |
18298 | 2663 |
^ codePoint between:$0 codePoint and:$9 codePoint. |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2664 |
]. |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2665 |
|
18268 | 2666 |
^ codePoint between:16rFF10 and:16rFF19 |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2667 |
! |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2668 |
|
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2669 |
isNationalLetter |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2670 |
"return true, if the receiver is a letter. |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2671 |
CAVEAT: |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2672 |
for now, this method is only correct for unicode characters up to u+1d6ff (Unicode3.1). |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2673 |
(which is more than mozilla does, btw. ;-)" |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2674 |
|
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2675 |
%{ /* NOCONTEXT */ |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2676 |
|
14684 | 2677 |
REGISTER INT val; |
2678 |
||
2679 |
/* because used so often, this is open coded, instead of table driven */ |
|
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2680 |
val = __intVal(__INST(asciivalue)); |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2681 |
switch (val >> 8) { |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2682 |
case 0x00: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2683 |
if ((unsigned INT)(val - 'A') <= ('Z' - 'A')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2684 |
RETURN ( true ); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2685 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2686 |
if ((unsigned INT)(val - 'a') <= ('z' - 'a')) { |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2687 |
RETURN ( true ); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2688 |
} |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2689 |
if (val == 0xAA) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2690 |
if (val == 0xB5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2691 |
if (val == 0xBA) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2692 |
if (val < 0xC0) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2693 |
if (val == 0xD7) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2694 |
if (val == 0xF7) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2695 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2696 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2697 |
case 0x01: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2698 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2699 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2700 |
case 0x02: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2701 |
#ifdef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2702 |
if (val <= 0x2B8) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2703 |
if (val == 0x2B9) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2704 |
if (val == 0x2BA) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2705 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2706 |
if (val <= 0x2BA) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2707 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2708 |
if (val <= 0x2C1) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2709 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2710 |
if (val <= 0x2C5) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2711 |
if (val <= 0x2CF) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2712 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2713 |
if (val == 0x2D0) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2714 |
if (val == 0x2D1) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2715 |
if (val <= 0x2DF) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2716 |
if (val <= 0x2E4) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2717 |
if (val == 0x2EE) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2718 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2719 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2720 |
case 0x03: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2721 |
if (val == 0x37A) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2722 |
if (val <= 0x385) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2723 |
if (val == 0x387) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2724 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2725 |
if (val == 0x3F6) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2726 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2727 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2728 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2729 |
case 0x04: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2730 |
if (val <= 0x481) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2731 |
if (val <= 0x486) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2732 |
if (val == 0x487) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2733 |
#ifdef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2734 |
if (val <= 0x48A) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2735 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2736 |
if (val <= 0x489) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2737 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2738 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2739 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2740 |
case 0x05: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2741 |
if (val <= 0x50f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2742 |
if (val <= 0x530) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2743 |
if (val <= 0x556) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2744 |
if (val <= 0x558) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2745 |
if (val <= 0x559) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2746 |
if (val <= 0x55F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2747 |
if (val <= 0x587) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2748 |
if (val <= 0x5cf) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2749 |
if (val <= 0x5f2) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2750 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2751 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2752 |
case 0x06: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2753 |
if (val <= 0x620) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2754 |
if (val <= 0x64A) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2755 |
if (val <= 0x66D) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2756 |
if (val == 0x670) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2757 |
if (val <= 0x6D3) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2758 |
if (val == 0x6D5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2759 |
if (val == 0x6E5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2760 |
if (val == 0x6E6) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2761 |
if (val == 0x6EE) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2762 |
if (val == 0x6EF) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2763 |
if (val == 0x6FA) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2764 |
if (val == 0x6FB) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2765 |
if (val == 0x6FC) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2766 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2767 |
if (val == 0x6FF) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2768 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2769 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2770 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2771 |
case 0x07: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2772 |
if (val <= 0x70F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2773 |
if (val == 0x711) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2774 |
if (val <= 0x72F) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2775 |
#ifdef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2776 |
if (val <= 0x74d) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2777 |
if (val <= 0x74e) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2778 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2779 |
if (val <= 0x74c) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2780 |
if (val <= 0x74f) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2781 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2782 |
if (val <= 0x77F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2783 |
if (val <= 0x7a5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2784 |
if (val <= 0x7af) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2785 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2786 |
if (val == 0x7B1) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2787 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2788 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2789 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2790 |
case 0x09: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2791 |
#ifdef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2792 |
if (val <= 0x904) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2793 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2794 |
if (val <= 0x903) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2795 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2796 |
if (val <= 0x93B) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2797 |
if (val == 0x93D) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2798 |
if (val == 0x950) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2799 |
if (val <= 0x957) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2800 |
if (val <= 0x961) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2801 |
if (val <= 0x984) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2802 |
if (val <= 0x9BB) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2803 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2804 |
if (val == 0x9BD) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2805 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2806 |
if (val <= 0x9DB) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2807 |
if (val <= 0x9E1) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2808 |
if (val <= 0x9EF) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2809 |
if (val <= 0x9F1) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2810 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2811 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2812 |
case 0x0A: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2813 |
if (val <= 0xa04) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2814 |
if (val <= 0xa3B) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2815 |
if (val <= 0xa58) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2816 |
if (val <= 0xa65) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2817 |
if (val <= 0xa71) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2818 |
if (val <= 0xa80) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2819 |
if (val <= 0xa84) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2820 |
if (val <= 0xaBB) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2821 |
if (val == 0xaBD) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2822 |
if (val <= 0xaCF) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2823 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2824 |
if (val == 0xAE2) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2825 |
if (val == 0xAE3) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2826 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2827 |
if (val <= 0xaE5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2828 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2829 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2830 |
case 0x0B: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2831 |
if (val <= 0xB04) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2832 |
if (val <= 0xb3B) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2833 |
if (val == 0xb3d) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2834 |
if (val <= 0xb5B) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2835 |
if (val <= 0xb65) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2836 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2837 |
if (val == 0xB71) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2838 |
if (val == 0xB83) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2839 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2840 |
if (val <= 0xb84) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2841 |
if (val <= 0xbBB) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2842 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2843 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2844 |
case 0x0c: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2845 |
if (val <= 0xc04) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2846 |
if (val <= 0xc3d) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2847 |
if (val <= 0xc5f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2848 |
if (val <= 0xc65) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2849 |
if (val <= 0xc84) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2850 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2851 |
if (val == 0xcbc) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2852 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2853 |
if (val <= 0xcbd) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2854 |
if (val <= 0xcdc) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2855 |
if (val <= 0xce5) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2856 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2857 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2858 |
case 0x0d: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2859 |
if (val <= 0xd04) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2860 |
if (val <= 0xd3d) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2861 |
if (val <= 0xd5f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2862 |
if (val <= 0xd65) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2863 |
if (val <= 0xd84) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2864 |
if (val <= 0xdc9) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2865 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2866 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2867 |
case 0x0E: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2868 |
if (val == 0xE31) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2869 |
if (val <= 0xE33) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2870 |
if (val <= 0xE3F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2871 |
if (val <= 0xE46) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2872 |
if (val <= 0xE7f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2873 |
if (val <= 0xEb0) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2874 |
if (val == 0xEb1) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2875 |
if (val <= 0xEb3) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2876 |
if (val <= 0xEbc) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2877 |
if (val <= 0xEc7) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2878 |
if (val <= 0xEdb) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2879 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2880 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2881 |
case 0x0F: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2882 |
if (val == 0xf00) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2883 |
if (val <= 0xf3F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2884 |
if (val <= 0xf70) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2885 |
if (val <= 0xf87) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2886 |
if (val <= 0xf8f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2887 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2888 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2889 |
case 0x10: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2890 |
if (val <= 0x102b) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2891 |
if (val <= 0x104f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2892 |
if (val <= 0x1055) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2893 |
if (val <= 0x109f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2894 |
if (val <= 0x10fa) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2895 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2896 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2897 |
case 0x11: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2898 |
case 0x12: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2899 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2900 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2901 |
case 0x13: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2902 |
if (val <= 0x1360) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2903 |
if (val <= 0x139f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2904 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2905 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2906 |
case 0x14: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2907 |
case 0x15: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2908 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2909 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2910 |
case 0x16: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2911 |
if (val == 0x166d) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2912 |
if (val == 0x166e) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2913 |
if (val == 0x1680) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2914 |
if (val == 0x169b) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2915 |
if (val == 0x169c) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2916 |
if (val <= 0x16ea) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2917 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2918 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2919 |
case 0x17: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2920 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2921 |
if (val == 0x1712) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2922 |
if (val == 0x1713) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2923 |
if (val == 0x1714) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2924 |
if (val == 0x1732) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2925 |
if (val == 0x1733) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2926 |
if (val == 0x1734) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2927 |
if (val == 0x1735) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2928 |
if (val == 0x1736) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2929 |
if (val == 0x1752) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2930 |
if (val == 0x1753) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2931 |
if (val == 0x1772) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2932 |
if (val == 0x1773) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2933 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2934 |
if (val <= 0x17b3) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2935 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2936 |
if (val == 0x17D7) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2937 |
if (val == 0x17DC) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2938 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2939 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2940 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2941 |
case 0x18: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2942 |
if (val <= 0x181f) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2943 |
if (val <= 0x18a8) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2944 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2945 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2946 |
case 0x19: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2947 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2948 |
if (val <= 0x191F) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2949 |
if (val <= 0x194F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2950 |
if (val <= 0x197F) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2951 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2952 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2953 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2954 |
case 0x1d: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2955 |
if (val <= 0x1d6B) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2956 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2957 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2958 |
case 0x1e: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2959 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2960 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2961 |
case 0x1f: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2962 |
if (val <= 0x1fbc) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2963 |
if (val == 0x1fbe) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2964 |
if (val <= 0x1fc1) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2965 |
if (val <= 0x1fcc) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2966 |
if (val <= 0x1fcf) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2967 |
if (val <= 0x1fdc) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2968 |
if (val <= 0x1fdf) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2969 |
if (val <= 0x1fec) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2970 |
if (val <= 0x1ff1) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2971 |
if (val <= 0x1ffc) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2972 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2973 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2974 |
case 0x20: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2975 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2976 |
if (val == 0x2071) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2977 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2978 |
if (val == 0x207f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2979 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2980 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2981 |
case 0x21: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2982 |
if (val == 0x2102) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2983 |
if (val == 0x2107) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2984 |
if (val <= 0x2109) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2985 |
if (val <= 0x2113) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2986 |
if (val == 0x2115) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2987 |
if (val <= 0x2118) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2988 |
if (val <= 0x211d) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2989 |
if (val <= 0x2123) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2990 |
if (val == 0x2125) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2991 |
if (val == 0x2127) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2992 |
if (val == 0x2129) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2993 |
if (val == 0x212E) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2994 |
if (val == 0x2132) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2995 |
if (val == 0x213A) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
2996 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2997 |
if (val == 0x213B) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2998 |
if (val <= 0x213F) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
2999 |
if (val <= 0x2144) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3000 |
if (val == 0x214A) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3001 |
if (val == 0x214B) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3002 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3003 |
if (val <= 0x2152) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3004 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3005 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3006 |
case 0x30: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3007 |
if (val == 0x3005) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3008 |
if (val == 0x3006) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3009 |
if (val <= 0x3030) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3010 |
if (val <= 0x3035) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3011 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3012 |
if (val == 0x303B) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3013 |
if (val == 0x303C) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3014 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3015 |
if (val <= 0x3040) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3016 |
if (val <= 0x3098) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3017 |
if (val <= 0x309c) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3018 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3019 |
if (val == 0x30A0) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3020 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3021 |
if (val == 0x30Fb) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3022 |
RETURN ((true)); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3023 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3024 |
case 0x31: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3025 |
if (val <= 0x318f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3026 |
if (val <= 0x319F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3027 |
RETURN ((true)); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3028 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3029 |
case 0x34: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3030 |
RETURN ((true)); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3031 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3032 |
case 0x4d: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3033 |
if (val <= 0x4DB4) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3034 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3035 |
if (val <= 0x4DBF) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3036 |
RETURN (false); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3037 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3038 |
RETURN (true); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3039 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3040 |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3041 |
case 0x4e: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3042 |
RETURN ((true)); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3043 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3044 |
case 0x9f: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3045 |
if (val <= 0x9fa4) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3046 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3047 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3048 |
case 0xA0: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3049 |
case 0xA1: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3050 |
case 0xA2: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3051 |
case 0xA3: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3052 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3053 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3054 |
case 0xA4: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3055 |
if (val <= 0xa48f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3056 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3057 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3058 |
case 0xA5: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3059 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3060 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3061 |
case 0xAC: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3062 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3063 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3064 |
case 0xD7: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3065 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3066 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3067 |
case 0xF9: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3068 |
case 0xFA: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3069 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3070 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3071 |
case 0xFB: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3072 |
if (val == 0xfb1e) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3073 |
if (val == 0xfb29) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3074 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3075 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3076 |
case 0xFC: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3077 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3078 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3079 |
case 0xFD: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3080 |
if (val <= 0xFD3d) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3081 |
if (val <= 0xFD4F) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3082 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3083 |
if (val == 0xFDFC) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3084 |
if (val == 0xFDFD) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3085 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3086 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3087 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3088 |
case 0xFE: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3089 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3090 |
if (val <= 0xFE0F) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3091 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3092 |
if (val <= 0xFE1f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3093 |
if (val <= 0xFE6F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3094 |
if (val <= 0xFEFE) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3095 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3096 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3097 |
case 0xFF: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3098 |
if (val <= 0xFF20) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3099 |
if (val <= 0xFF3a) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3100 |
if (val <= 0xFF40) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3101 |
if (val <= 0xFF5a) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3102 |
if (val <= 0xFF65) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3103 |
if (val <= 0xFFdC) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3104 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3105 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3106 |
case 0x100: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3107 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3108 |
RETURN (true); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3109 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3110 |
RETURN (false); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3111 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3112 |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3113 |
case 0x103: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3114 |
if (val <= 0x1031f) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3115 |
if (val <= 0x1032F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3116 |
if (val <= 0x10349) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3117 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3118 |
if (val <= 0x1037F) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3119 |
if (val <= 0x1039E) { RETURN (true); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3120 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3121 |
RETURN (false); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3122 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3123 |
case 0x104: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3124 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3125 |
if (val <= 0x1049F) { RETURN (true); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3126 |
if (val <= 0x104aF) { RETURN (false); } |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3127 |
#endif |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3128 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3129 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3130 |
case 0x108: |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3131 |
#ifndef UNICODE_3_2 |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3132 |
RETURN (true); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3133 |
#else |
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3134 |
RETURN (false); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3135 |
#endif |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3136 |
|
20706
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3137 |
case 0x1D4: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3138 |
case 0x1D5: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3139 |
RETURN (true); |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3140 |
|
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3141 |
case 0x1D6: |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3142 |
if (val == 0x1d6c1) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3143 |
if (val == 0x1d6db) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3144 |
if (val == 0x1d6fb) { RETURN (false); } |
009b8269bd08
we have class based exceptions - use them
Claus Gittinger <cg@exept.de>
parents:
20698
diff
changeset
|
3145 |
RETURN (true); |
8030
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3146 |
} |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3147 |
RETURN (false); |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3148 |
%} |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3149 |
! ! |
5a4323d0280f
updated to Unicode4.0.0 spec
Claus Gittinger <cg@exept.de>
parents:
8029
diff
changeset
|
3150 |
|
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3151 |
!Character methodsFor:'tracing'! |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3152 |
|
4682 | 3153 |
traceInto:aRequestor level:level from:referrer |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3154 |
"double dispatch into tracer, passing my type implicitely in the selector" |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3155 |
|
4682 | 3156 |
^ aRequestor traceCharacter:self level:level from:referrer |
4655
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3157 |
|
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3158 |
! ! |
b9405ca0bb4e
added #hasSharedInstances & tracing support
Claus Gittinger <cg@exept.de>
parents:
4340
diff
changeset
|
3159 |
|
8394
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3160 |
!Character methodsFor:'visiting'! |
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3161 |
|
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3162 |
acceptVisitor:aVisitor with:aParameter |
16727 | 3163 |
"dispatch for visitor pattern; send #visitCharacter:with: to aVisitor" |
8394
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3164 |
|
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3165 |
^ aVisitor visitCharacter:self with:aParameter |
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3166 |
! ! |
da194de43766
Generalize visitor pattern and define #visit...:with: -methods instead
Stefan Vogel <sv@exept.de>
parents:
8308
diff
changeset
|
3167 |
|
2124 | 3168 |
!Character class methodsFor:'documentation'! |
699 | 3169 |
|
3170 |
version |
|
18588 | 3171 |
^ '$Header$' |
14120
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
3172 |
! |
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
3173 |
|
fdf215af772c
added: #displayOn: (instead of #displaySting)
Stefan Vogel <sv@exept.de>
parents:
14117
diff
changeset
|
3174 |
version_CVS |
18588 | 3175 |
^ '$Header$' |
699 | 3176 |
! ! |