BIG5EncodedString.st
author Claus Gittinger <cg@exept.de>
Sat, 02 May 2020 21:40:13 +0200
changeset 5476 7355a4b11cb6
parent 4135 16a9f3bf9327
permissions -rw-r--r--
#FEATURE by cg class: Socket class added: #newTCPclientToHost:port:domain:domainOrder:withTimeout: changed: #newTCPclientToHost:port:domain:withTimeout:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
543
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
     1
"
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
     3
              All Rights Reserved
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
     4
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
     5
 This software is furnished under a license and may be used
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
     6
 only in accordance with the terms of that license and with the
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
     8
 be provided or otherwise made available to, or used by, any
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
     9
 other person.  No title to or ownership of the software is
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    10
 hereby transferred.
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    11
"
4135
16a9f3bf9327 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
    12
"{ Package: 'stx:libbasic2' }"
543
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    13
4135
16a9f3bf9327 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
    14
"{ NameSpace: Smalltalk }"
1426
1f5ee0a4cfe4 document string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
    15
1f5ee0a4cfe4 document string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
    16
TwoByteString variableWordSubclass:#BIG5EncodedString
229
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Collections-Text'
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!BIG5EncodedString class methodsFor:'documentation'!
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
543
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    25
copyright
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    26
"
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    27
 COPYRIGHT (c) 1995 by Claus Gittinger
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    28
              All Rights Reserved
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    29
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    30
 This software is furnished under a license and may be used
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    31
 only in accordance with the terms of that license and with the
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    33
 be provided or otherwise made available to, or used by, any
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    34
 other person.  No title to or ownership of the software is
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    35
 hereby transferred.
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    36
"
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    37
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    38
!
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    39
229
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
documentation
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
1426
1f5ee0a4cfe4 document string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
    42
    OBSOLETE
1f5ee0a4cfe4 document string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
    43
        this class will vanish - its functionality has been replaced
1f5ee0a4cfe4 document string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
    44
        by the UnicodeString classes.
1f5ee0a4cfe4 document string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
    45
229
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    BIG5EncodedString represents 16bit strings encoded in BIG-5.
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    BIG-5 is a popular hanzi code used in Taiwan.
261
2fd450dd712f commentary
Claus Gittinger <cg@exept.de>
parents: 260
diff changeset
    48
2fd450dd712f commentary
Claus Gittinger <cg@exept.de>
parents: 260
diff changeset
    49
    [author:]
2fd450dd712f commentary
Claus Gittinger <cg@exept.de>
parents: 260
diff changeset
    50
        Claus Gittinger
2fd450dd712f commentary
Claus Gittinger <cg@exept.de>
parents: 260
diff changeset
    51
2fd450dd712f commentary
Claus Gittinger <cg@exept.de>
parents: 260
diff changeset
    52
    [see also:]
4135
16a9f3bf9327 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
    53
        Unicode16String
261
2fd450dd712f commentary
Claus Gittinger <cg@exept.de>
parents: 260
diff changeset
    54
        GBEncodedString JISEncodedString 
2fd450dd712f commentary
Claus Gittinger <cg@exept.de>
parents: 260
diff changeset
    55
        TwoByteString String CharacterArray
2fd450dd712f commentary
Claus Gittinger <cg@exept.de>
parents: 260
diff changeset
    56
        StringCollection
229
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
"
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
! !
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
260
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    60
!BIG5EncodedString class methodsFor:'initialization'!
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    61
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    62
initialize
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    63
    "initialize the class - private"
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    64
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    65
    self flags:(Behavior flagWords)
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    66
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    67
    "
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    68
     BIG5EncodedString initialize
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    69
    "
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    70
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    71
    "Created: 27.4.1996 / 13:12:30 / cg"
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    72
! !
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
    73
231
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    74
!BIG5EncodedString class methodsFor:'code tables'!
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    75
543
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
    76
romanTable
231
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    77
    "return a table to decode from roman ascii to 16 bit BIG5.
265
6024db111b9d commentary
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
    78
     This is experimental - possibly unfinished or incorrect"
231
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    79
544
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
    80
    ^ #(    "   "   "excla"         " # "   " $ "   " % "   " & "   " ' "
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
    81
          16ra1bc 16ra149 16ra1b2 16ra1ad 16ra243 16ra248 16ra1ae 16ra1ac 
231
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    82
            " ( "   " ) "   " * "   " + "   " , "   " - "   " . "   " / "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    83
          16ra15d 16ra15e 16ra1ce 16ra1cf 16ra14d 16ra1df 16ra14f 16ra1fe
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    84
            " 0 "   " 1 "   " 2 "   " 3 "   " 4 "   " 5 "   " 6 "   " 7 "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    85
          16ra2af 16ra2b0 16ra2b1 16ra2b2 16ra2b3 16ra2b4 16ra2b5 16ra2b6
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    86
            " 8 "   " 9 "   " : "   " ; "   " < "   " = "   " > "   " ? "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    87
          16ra2b7 16ra2b8 16ra152 16ra151 16ra1e0 16ra1e2 16ra1e1 16ra148 
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    88
            " @ "   " A "   " B "   " C "   " D "   " E "   " F "   " G "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    89
          16ra249 16ra2cf 16ra2d0 16ra2d1 16ra2d2 16ra2d3 16ra2d4 16ra2d5 
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    90
            " H "   " I "   " J "   " K "   " L "   " M "   " N "   " O "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    91
          16ra2d6 16ra2d7 16ra2d8 16ra2d9 16ra2da 16ra2db 16ra2dc 16ra2dd 
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    92
            " P "   " Q "   " R "   " S "   " T "   " U "   " V "   " W "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    93
          16ra2de 16ra2df 16ra2e0 16ra2e1 16ra2e2 16ra2e3 16ra2e4 16ra2e5 
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    94
            " X "   " Y "   " Z "   " [ "   " \ "   " ] "   " ^ "   " _ "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    95
          16ra2e6 16ra2e7 16ra2e8 16ra169 16ra242 16ra16a 16ra173 16ra15a
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    96
            " ` "   " a "   " b "   " c "   " d "   " e "   " f "   " g "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    97
          16ra1ab 16ra2e9 16ra2ea 16ra2eb 16ra2ec 16ra2ed 16ra2ee 16ra2ef 
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    98
            " h "   " i "   " j "   " k "   " l "   " m "   " n "   " o "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
    99
          16ra2f0 16ra2f1 16ra2f2 16ra2f3 16ra2f4 16ra2f5 16ra2f6 16ra2f7 
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   100
            " p "   " q "   " r "   " s "   " t "   " u "   " v "   " w "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   101
          16ra2f8 16ra2f9 16ra2fa 16ra2fb 16ra2fc 16ra2fd 16ra2fe 16ra340 
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   102
            " x "   " y "   " z "   " { "   " | "   " } "  " ~ "
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   103
          16ra341 16ra342 16ra343 16ra161 16ra157 16ra162 16ra1e3 16ra1bd
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   104
544
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   105
"/          16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   106
"/          16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   107
"/          16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   108
"/          16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   109
"/          16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   110
"/          16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   111
"/          16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   112
"/          16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 16ra1bc 
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   113
        ).
231
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   114
543
9c29370c7dc8 fixed BIG5 encoding stuff
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   115
    "Created: 30.6.1997 / 14:26:26 / cg"
544
0252a2641433 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   116
    "Modified: 30.6.1997 / 18:22:30 / cg"
231
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   117
! !
5d28780c8859 code table moved to BIG5EncodedString
Claus Gittinger <cg@exept.de>
parents: 229
diff changeset
   118
229
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
!BIG5EncodedString methodsFor:'queries'!
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
encoding
264
1e508408ecf5 commentary
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   122
    "return the strings encoding as a symbol. 
1e508408ecf5 commentary
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   123
     Here, the constant symbol #big5 is returned."
240
7af04274190d commentary
Claus Gittinger <cg@exept.de>
parents: 231
diff changeset
   124
229
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    ^ #big5
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    "Created: 17.4.1996 / 15:41:15 / cg"
264
1e508408ecf5 commentary
Claus Gittinger <cg@exept.de>
parents: 261
diff changeset
   128
    "Modified: 27.4.1996 / 13:23:01 / cg"
229
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
! !
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
!BIG5EncodedString class methodsFor:'documentation'!
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
version
4135
16a9f3bf9327 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
   134
    ^ '$Header$'
229
3b126b43392b intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
! !
1426
1f5ee0a4cfe4 document string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
   136
4135
16a9f3bf9327 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
   137
260
427397326fac need explicit #initialize (due to startup optimization)
Claus Gittinger <cg@exept.de>
parents: 240
diff changeset
   138
BIG5EncodedString initialize!