CharacterEncoderImplementations__MS_Ansi.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 22589 a54279da036e
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17624
acb2e49fb3ab class: CharacterEncoderImplementations::MS_Ansi
Stefan Vogel <sv@exept.de>
parents: 14560
diff changeset
     1
"{ Encoding: utf8 }"
acb2e49fb3ab class: CharacterEncoderImplementations::MS_Ansi
Stefan Vogel <sv@exept.de>
parents: 14560
diff changeset
     2
8148
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
     3
"
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
     4
 COPYRIGHT (c) 2004 by eXept Software AG
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
     5
              All Rights Reserved
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
     6
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
     7
 This software is furnished under a license and may be used
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
     8
 only in accordance with the terms of that license and with the
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    10
 be provided or otherwise made available to, or used by, any
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    11
 other person.  No title to or ownership of the software is
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    12
 hereby transferred.
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    13
"
8081
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libbasic' }"
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
"{ NameSpace: CharacterEncoderImplementations }"
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
    18
VariableBytesEncoder subclass:#MS_Ansi
8081
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:''
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'Collections-Text-Encodings'
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
8148
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    25
!MS_Ansi class methodsFor:'documentation'!
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    26
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    27
copyright
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    28
"
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    29
 COPYRIGHT (c) 2004 by eXept Software AG
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    30
              All Rights Reserved
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    31
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    32
 This software is furnished under a license and may be used
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    33
 only in accordance with the terms of that license and with the
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    35
 be provided or otherwise made available to, or used by, any
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    36
 other person.  No title to or ownership of the software is
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    37
 hereby transferred.
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    38
"
8813
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    39
!
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    40
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    41
documentation
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    42
"
22585
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
    43
    Microsoft ANSI - which is what Microsoft thought what is ANSI coding in the 80s (whatever that should be).
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
    44
    It is definitely not an ANSI standard!!
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
    45
22585
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
    46
    In fact it is CP1252 encoding which is based on iso8859-1. 
22583
879bd9713cb9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22501
diff changeset
    47
    Codepoints 0x80–0x9F which are control characters
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
    48
    in iso8859 are mapped to special windows characters.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
    49
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
    50
    Apparently, meanwhile Microsoft supports codepoints above 0xff as unicode.
22585
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
    51
    We map unicode codepoints which are defined in CP1552 to CP1552, 
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
    52
    and leave others unchanged.
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
    53
    So this encoder will return characters above 0xFF if required.
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
    54
    (compare to MS_CP1252, which does not)
8813
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    55
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    56
    [see with:]
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    57
        CharacterEncoderImplementations::MS_Ansi showCharacterSet
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    58
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    59
    [author:]
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    60
        Claus Gittinger
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    61
"
8148
dbf64e3142d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8139
diff changeset
    62
! !
8081
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
!MS_Ansi class methodsFor:'mapping'!
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
mapFileURL2_relativePathName
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    ^ 'CP1252'
8813
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    68
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    69
    "
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    70
     self generateCode
c2908c7fc648 documentation
Claus Gittinger <cg@exept.de>
parents: 8148
diff changeset
    71
    "
8081
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
!
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
mapping
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
"
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
# From: http://std.dkuug.dk/i18n/charmaps/CP1252
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
<code_set_name> CP1252
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
<comment_char> %
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
<escape_char> /
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
% version: 1.0
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
% repertoiremap: mnemonic,ds
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
%  source: UNICODE 1.0
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
% alias MS-ANSI
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
CHARMAP
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
<NU>                   /x00   <U0000> NULL (NUL)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
<SH>                   /x01   <U0001> START OF HEADING (SOH)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
<SX>                   /x02   <U0002> START OF TEXT (STX)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
<EX>                   /x03   <U0003> END OF TEXT (ETX)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
<ET>                   /x04   <U0004> END OF TRANSMISSION (EOT)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
<EQ>                   /x05   <U0005> ENQUIRY (ENQ)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
<AK>                   /x06   <U0006> ACKNOWLEDGE (ACK)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
<BL>                   /x07   <U0007> BELL (BEL)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
<BS>                   /x08   <U0008> BACKSPACE (BS)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
<HT>                   /x09   <U0009> CHARACTER TABULATION (HT)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
<LF>                   /x0A   <U000A> LINE FEED (LF)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
<VT>                   /x0B   <U000B> LINE TABULATION (VT)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
<FF>                   /x0C   <U000C> FORM FEED (FF)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
<CR>                   /x0D   <U000D> CARRIAGE RETURN (CR)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
<SO>                   /x0E   <U000E> SHIFT OUT (SO)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
<SI>                   /x0F   <U000F> SHIFT IN (SI)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
<DL>                   /x10   <U0010> DATALINK ESCAPE (DLE)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
<D1>                   /x11   <U0011> DEVICE CONTROL ONE (DC1)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
<D2>                   /x12   <U0012> DEVICE CONTROL TWO (DC2)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
<D3>                   /x13   <U0013> DEVICE CONTROL THREE (DC3)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
<D4>                   /x14   <U0014> DEVICE CONTROL FOUR (DC4)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
<NK>                   /x15   <U0015> NEGATIVE ACKNOWLEDGE (NAK)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
<SY>                   /x16   <U0016> SYNCHRONOUS IDLE (SYN)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
<EB>                   /x17   <U0017> END OF TRANSMISSION BLOCK (ETB)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
<CN>                   /x18   <U0018> CANCEL (CAN)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
<EM>                   /x19   <U0019> END OF MEDIUM (EM)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
<SB>                   /x1A   <U001A> SUBSTITUTE (SUB)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
<EC>                   /x1B   <U001B> ESCAPE (ESC)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
<FS>                   /x1C   <U001C> FILE SEPARATOR (IS4)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
<GS>                   /x1D   <U001D> GROUP SEPARATOR (IS3)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
<RS>                   /x1E   <U001E> RECORD SEPARATOR (IS2)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
<US>                   /x1F   <U001F> UNIT SEPARATOR (IS1)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
<SP>                   /x20   <U0020> SPACE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
<!!>                    /x21   <U0021> EXCLAMATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
<'>                    /x22   <U0022> QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
<Nb>                   /x23   <U0023> NUMBER SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
<DO>                   /x24   <U0024> DOLLAR SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
<%>                    /x25   <U0025> PERCENT SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
<&>                    /x26   <U0026> AMPERSAND
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
<'>                    /x27   <U0027> APOSTROPHE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
<(>                    /x28   <U0028> LEFT PARENTHESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
<)>                    /x29   <U0029> RIGHT PARENTHESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
<*>                    /x2A   <U002A> ASTERISK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
<+>                    /x2B   <U002B> PLUS SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
<,>                    /x2C   <U002C> COMMA
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
<->                    /x2D   <U002D> HYPHEN-MINUS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
<.>                    /x2E   <U002E> FULL STOP
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
<//>                   /x2F   <U002F> SOLIDUS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
<0>                    /x30   <U0030> DIGIT ZERO
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
<1>                    /x31   <U0031> DIGIT ONE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
<2>                    /x32   <U0032> DIGIT TWO
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
<3>                    /x33   <U0033> DIGIT THREE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
<4>                    /x34   <U0034> DIGIT FOUR
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
<5>                    /x35   <U0035> DIGIT FIVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
<6>                    /x36   <U0036> DIGIT SIX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
<7>                    /x37   <U0037> DIGIT SEVEN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
<8>                    /x38   <U0038> DIGIT EIGHT
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
<9>                    /x39   <U0039> DIGIT NINE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
<:>                    /x3A   <U003A> COLON
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
<;>                    /x3B   <U003B> SEMICOLON
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
<<>                    /x3C   <U003C> LESS-THAN SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
<=>                    /x3D   <U003D> EQUALS SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
</>>                   /x3E   <U003E> GREATER-THAN SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
<?>                    /x3F   <U003F> QUESTION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
<At>                   /x40   <U0040> COMMERCIAL AT
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
<A>                    /x41   <U0041> LATIN CAPITAL LETTER A
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
<B>                    /x42   <U0042> LATIN CAPITAL LETTER B
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
<C>                    /x43   <U0043> LATIN CAPITAL LETTER C
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
<D>                    /x44   <U0044> LATIN CAPITAL LETTER D
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
<E>                    /x45   <U0045> LATIN CAPITAL LETTER E
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
<F>                    /x46   <U0046> LATIN CAPITAL LETTER F
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
<G>                    /x47   <U0047> LATIN CAPITAL LETTER G
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
<H>                    /x48   <U0048> LATIN CAPITAL LETTER H
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
<I>                    /x49   <U0049> LATIN CAPITAL LETTER I
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
<J>                    /x4A   <U004A> LATIN CAPITAL LETTER J
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
<K>                    /x4B   <U004B> LATIN CAPITAL LETTER K
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
<L>                    /x4C   <U004C> LATIN CAPITAL LETTER L
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
<M>                    /x4D   <U004D> LATIN CAPITAL LETTER M
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
<N>                    /x4E   <U004E> LATIN CAPITAL LETTER N
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
<O>                    /x4F   <U004F> LATIN CAPITAL LETTER O
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
<P>                    /x50   <U0050> LATIN CAPITAL LETTER P
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
<Q>                    /x51   <U0051> LATIN CAPITAL LETTER Q
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
<R>                    /x52   <U0052> LATIN CAPITAL LETTER R
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
<S>                    /x53   <U0053> LATIN CAPITAL LETTER S
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
<T>                    /x54   <U0054> LATIN CAPITAL LETTER T
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
<U>                    /x55   <U0055> LATIN CAPITAL LETTER U
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
<V>                    /x56   <U0056> LATIN CAPITAL LETTER V
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
<W>                    /x57   <U0057> LATIN CAPITAL LETTER W
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
<X>                    /x58   <U0058> LATIN CAPITAL LETTER X
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
<Y>                    /x59   <U0059> LATIN CAPITAL LETTER Y
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
<Z>                    /x5A   <U005A> LATIN CAPITAL LETTER Z
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
<<(>                   /x5B   <U005B> LEFT SQUARE BRACKET
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
<////>                 /x5C   <U005C> REVERSE SOLIDUS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
<)/>>                  /x5D   <U005D> RIGHT SQUARE BRACKET
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
<'/>>                  /x5E   <U005E> CIRCUMFLEX ACCENT
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
<_>                    /x5F   <U005F> LOW LINE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
<'!!>                   /x60   <U0060> GRAVE ACCENT
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
<a>                    /x61   <U0061> LATIN SMALL LETTER A
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
<b>                    /x62   <U0062> LATIN SMALL LETTER B
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
<c>                    /x63   <U0063> LATIN SMALL LETTER C
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
<d>                    /x64   <U0064> LATIN SMALL LETTER D
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
<e>                    /x65   <U0065> LATIN SMALL LETTER E
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
<f>                    /x66   <U0066> LATIN SMALL LETTER F
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
<g>                    /x67   <U0067> LATIN SMALL LETTER G
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
<h>                    /x68   <U0068> LATIN SMALL LETTER H
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
<i>                    /x69   <U0069> LATIN SMALL LETTER I
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
<j>                    /x6A   <U006A> LATIN SMALL LETTER J
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
<k>                    /x6B   <U006B> LATIN SMALL LETTER K
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
<l>                    /x6C   <U006C> LATIN SMALL LETTER L
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
<m>                    /x6D   <U006D> LATIN SMALL LETTER M
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
<n>                    /x6E   <U006E> LATIN SMALL LETTER N
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
<o>                    /x6F   <U006F> LATIN SMALL LETTER O
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
<p>                    /x70   <U0070> LATIN SMALL LETTER P
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
<q>                    /x71   <U0071> LATIN SMALL LETTER Q
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
<r>                    /x72   <U0072> LATIN SMALL LETTER R
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
<s>                    /x73   <U0073> LATIN SMALL LETTER S
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
<t>                    /x74   <U0074> LATIN SMALL LETTER T
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
<u>                    /x75   <U0075> LATIN SMALL LETTER U
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
<v>                    /x76   <U0076> LATIN SMALL LETTER V
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
<w>                    /x77   <U0077> LATIN SMALL LETTER W
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
<x>                    /x78   <U0078> LATIN SMALL LETTER X
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
<y>                    /x79   <U0079> LATIN SMALL LETTER Y
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
<z>                    /x7A   <U007A> LATIN SMALL LETTER Z
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
<(!!>                   /x7B   <U007B> LEFT CURLY BRACKET
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
<!!!!>                   /x7C   <U007C> VERTICAL LINE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
<!!)>                   /x7D   <U007D> RIGHT CURLY BRACKET
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
<'?>                   /x7E   <U007E> TILDE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
<DT>                   /x7F   <U007F> DELETE (DEL)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
<.9>                   /x82   <U201A> SINGLE LOW-9 QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
<f2>                   /x83   <U0192> LATIN SMALL LETTER F WITH HOOK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
<:9>                   /x84   <U201E> DOUBLE LOW-9 QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
<.3>                   /x85   <U2026> HORIZONTAL ELLIPSIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
<//->                  /x86   <U2020> DAGGER
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
<//=>                  /x87   <U2021> DOUBLE DAGGER
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
<1/>>                  /x88   <U02C6> MODIFIER LETTER CIRCUMFLEX ACCENT
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
<%0>                   /x89   <U2030> PER MILLE SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
<S<>                   /x8A   <U0160> LATIN CAPITAL LETTER S WITH CARON
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
<<1>                   /x8B   <U2039> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
<OE>                   /x8C   <U0152> LATIN CAPITAL LIGATURE OE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
<'6>                   /x91   <U2018> LEFT SINGLE QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
<'9>                   /x92   <U2019> RIGHT SINGLE QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
<'6>                   /x93   <U201C> LEFT DOUBLE QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
<'9>                   /x94   <U201D> RIGHT DOUBLE QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
<sb>                   /x95   <U2022> BULLET
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
<-N>                   /x96   <U2013> EN DASH
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
<-M>                   /x97   <U2014> EM DASH
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
<1?>                   /x98   <U02DC> SMALL TILDE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
<TM>                   /x99   <U2122> TRADE MARK SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
<s<>                   /x9A   <U0161> LATIN SMALL LETTER S WITH CARON
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
</>1>                  /x9B   <U203A> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
<oe>                   /x9C   <U0153> LATIN SMALL LIGATURE OE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
<Y:>                   /x9F   <U0178> LATIN CAPITAL LETTER Y WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
<NS>                   /xA0   <U00A0> NO-BREAK SPACE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
<!!I>                   /xA1   <U00A1> INVERTED EXCLAMATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
<Ct>                   /xA2   <U00A2> CENT SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
<Pd>                   /xA3   <U00A3> POUND SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
<Cu>                   /xA4   <U00A4> CURRENCY SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
<Ye>                   /xA5   <U00A5> YEN SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
<BB>                   /xA6   <U00A6> BROKEN BAR
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
<SE>                   /xA7   <U00A7> SECTION SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
<':>                   /xA8   <U00A8> DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
<Co>                   /xA9   <U00A9> COPYRIGHT SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
<-a>                   /xAA   <U00AA> FEMININE ORDINAL INDICATOR
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
<<<>                   /xAB   <U00AB> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
<NO>                   /xAC   <U00AC> NOT SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
<-->                   /xAD   <U00AD> SOFT HYPHEN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
<Rg>                   /xAE   <U00AE> REGISTERED SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
<'m>                   /xAF   <U00AF> MACRON
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
<DG>                   /xB0   <U00B0> DEGREE SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
<+->                   /xB1   <U00B1> PLUS-MINUS SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
<2S>                   /xB2   <U00B2> SUPERSCRIPT TWO
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
<3S>                   /xB3   <U00B3> SUPERSCRIPT THREE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
<''>                   /xB4   <U00B4> ACUTE ACCENT
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
<My>                   /xB5   <U00B5> MICRO SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
<PI>                   /xB6   <U00B6> PILCROW SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
<.M>                   /xB7   <U00B7> MIDDLE DOT
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
<',>                   /xB8   <U00B8> CEDILLA
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
<1S>                   /xB9   <U00B9> SUPERSCRIPT ONE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
<-o>                   /xBA   <U00BA> MASCULINE ORDINAL INDICATOR
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
</>/>>                 /xBB   <U00BB> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
<14>                   /xBC   <U00BC> VULGAR FRACTION ONE QUARTER
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
<12>                   /xBD   <U00BD> VULGAR FRACTION ONE HALF
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
<34>                   /xBE   <U00BE> VULGAR FRACTION THREE QUARTERS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
<?I>                   /xBF   <U00BF> INVERTED QUESTION MARK
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
<A!!>                   /xC0   <U00C0> LATIN CAPITAL LETTER A WITH GRAVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
<A'>                   /xC1   <U00C1> LATIN CAPITAL LETTER A WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
<A/>>                  /xC2   <U00C2> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
<A?>                   /xC3   <U00C3> LATIN CAPITAL LETTER A WITH TILDE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
<A:>                   /xC4   <U00C4> LATIN CAPITAL LETTER A WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
<AA>                   /xC5   <U00C5> LATIN CAPITAL LETTER A WITH RING ABOVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
<AE>                   /xC6   <U00C6> LATIN CAPITAL LETTER AE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
<C,>                   /xC7   <U00C7> LATIN CAPITAL LETTER C WITH CEDILLA
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
<E!!>                   /xC8   <U00C8> LATIN CAPITAL LETTER E WITH GRAVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
<E'>                   /xC9   <U00C9> LATIN CAPITAL LETTER E WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
<E/>>                  /xCA   <U00CA> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
<E:>                   /xCB   <U00CB> LATIN CAPITAL LETTER E WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
<I!!>                   /xCC   <U00CC> LATIN CAPITAL LETTER I WITH GRAVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
<I'>                   /xCD   <U00CD> LATIN CAPITAL LETTER I WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
<I/>>                  /xCE   <U00CE> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
<I:>                   /xCF   <U00CF> LATIN CAPITAL LETTER I WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
<D->                   /xD0   <U00D0> LATIN CAPITAL LETTER ETH (Icelandic)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
<N?>                   /xD1   <U00D1> LATIN CAPITAL LETTER N WITH TILDE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
<O!!>                   /xD2   <U00D2> LATIN CAPITAL LETTER O WITH GRAVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
<O'>                   /xD3   <U00D3> LATIN CAPITAL LETTER O WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
<O/>>                  /xD4   <U00D4> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
<O?>                   /xD5   <U00D5> LATIN CAPITAL LETTER O WITH TILDE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
<O:>                   /xD6   <U00D6> LATIN CAPITAL LETTER O WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
<*X>                   /xD7   <U00D7> MULTIPLICATION SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
<O//>                  /xD8   <U00D8> LATIN CAPITAL LETTER O WITH STROKE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
<U!!>                   /xD9   <U00D9> LATIN CAPITAL LETTER U WITH GRAVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
<U'>                   /xDA   <U00DA> LATIN CAPITAL LETTER U WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
<U/>>                  /xDB   <U00DB> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
<U:>                   /xDC   <U00DC> LATIN CAPITAL LETTER U WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
<Y'>                   /xDD   <U00DD> LATIN CAPITAL LETTER Y WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
<TH>                   /xDE   <U00DE> LATIN CAPITAL LETTER THORN (Icelandic)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
<ss>                   /xDF   <U00DF> LATIN SMALL LETTER SHARP S (German)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
<a!!>                   /xE0   <U00E0> LATIN SMALL LETTER A WITH GRAVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
<a'>                   /xE1   <U00E1> LATIN SMALL LETTER A WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
<a/>>                  /xE2   <U00E2> LATIN SMALL LETTER A WITH CIRCUMFLEX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
<a?>                   /xE3   <U00E3> LATIN SMALL LETTER A WITH TILDE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
<a:>                   /xE4   <U00E4> LATIN SMALL LETTER A WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
<aa>                   /xE5   <U00E5> LATIN SMALL LETTER A WITH RING ABOVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
<ae>                   /xE6   <U00E6> LATIN SMALL LETTER AE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
<c,>                   /xE7   <U00E7> LATIN SMALL LETTER C WITH CEDILLA
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
<e!!>                   /xE8   <U00E8> LATIN SMALL LETTER E WITH GRAVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
<e'>                   /xE9   <U00E9> LATIN SMALL LETTER E WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
<e/>>                  /xEA   <U00EA> LATIN SMALL LETTER E WITH CIRCUMFLEX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
<e:>                   /xEB   <U00EB> LATIN SMALL LETTER E WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
<i!!>                   /xEC   <U00EC> LATIN SMALL LETTER I WITH GRAVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
<i'>                   /xED   <U00ED> LATIN SMALL LETTER I WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
<i/>>                  /xEE   <U00EE> LATIN SMALL LETTER I WITH CIRCUMFLEX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
<i:>                   /xEF   <U00EF> LATIN SMALL LETTER I WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
<d->                   /xF0   <U00F0> LATIN SMALL LETTER ETH (Icelandic)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
<n?>                   /xF1   <U00F1> LATIN SMALL LETTER N WITH TILDE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
<o!!>                   /xF2   <U00F2> LATIN SMALL LETTER O WITH GRAVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
<o'>                   /xF3   <U00F3> LATIN SMALL LETTER O WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
<o/>>                  /xF4   <U00F4> LATIN SMALL LETTER O WITH CIRCUMFLEX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
<o?>                   /xF5   <U00F5> LATIN SMALL LETTER O WITH TILDE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
<o:>                   /xF6   <U00F6> LATIN SMALL LETTER O WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
<-:>                   /xF7   <U00F7> DIVISION SIGN
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
<o//>                  /xF8   <U00F8> LATIN SMALL LETTER O WITH STROKE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
<u!!>                   /xF9   <U00F9> LATIN SMALL LETTER U WITH GRAVE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
<u'>                   /xFA   <U00FA> LATIN SMALL LETTER U WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
<u/>>                  /xFB   <U00FB> LATIN SMALL LETTER U WITH CIRCUMFLEX
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
<u:>                   /xFC   <U00FC> LATIN SMALL LETTER U WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
<y'>                   /xFD   <U00FD> LATIN SMALL LETTER Y WITH ACUTE
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
<th>                   /xFE   <U00FE> LATIN SMALL LETTER THORN (Icelandic)
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
<y:>                   /xFF   <U00FF> LATIN SMALL LETTER Y WITH DIAERESIS
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
END CHARMAP
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
"
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
! !
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   340
!MS_Ansi class methodsFor:'queries'!
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   341
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   342
maxCode
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   343
    ^ 65535 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   344
!
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   345
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   346
minCode
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   347
    ^ 0 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   348
! !
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   349
8139
5968d9ac107e MS-ANSI
Claus Gittinger <cg@exept.de>
parents: 8114
diff changeset
   350
!MS_Ansi methodsFor:'encoding & decoding'!
5968d9ac107e MS-ANSI
Claus Gittinger <cg@exept.de>
parents: 8114
diff changeset
   351
5968d9ac107e MS-ANSI
Claus Gittinger <cg@exept.de>
parents: 8114
diff changeset
   352
decode:codeArg
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   353
    |code "{ Class: SmallInteger }" t|
8139
5968d9ac107e MS-ANSI
Claus Gittinger <cg@exept.de>
parents: 8114
diff changeset
   354
14203
b19842b57af5 changed:
Claus Gittinger <cg@exept.de>
parents: 11000
diff changeset
   355
    code := codeArg.
b19842b57af5 changed:
Claus Gittinger <cg@exept.de>
parents: 11000
diff changeset
   356
    code <= 16r7F ifTrue:[ ^ code ].
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   357
    code >= 16rA0 ifTrue:[
14203
b19842b57af5 changed:
Claus Gittinger <cg@exept.de>
parents: 11000
diff changeset
   358
        ^ codeArg.
b19842b57af5 changed:
Claus Gittinger <cg@exept.de>
parents: 11000
diff changeset
   359
    ].
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   360
22583
879bd9713cb9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22501
diff changeset
   361
    "similar to 8859-1 with different chars in the 8x..9x area"
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   362
    "we map CP1252 chars to unicode chars"
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   363
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   364
    t := #(
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   365
       "16r0080"    16r20AC " EURO character " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   366
       "16r0081"    16r0000 " invalid " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   367
       "16r0082"    16r201A " SINGLE LOW-9 QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   368
       "16r0083"    16r0192 " LATIN SMALL LETTER F WITH HOOK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   369
       "16r0084"    16r201E " DOUBLE LOW-9 QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   370
       "16r0085"    16r2026 " HORIZONTAL ELLIPSIS " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   371
       "16r0086"    16r2020 " DAGGER " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   372
       "16r0087"    16r2021 " DOUBLE DAGGER " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   373
       "16r0088"    16r02C6 " MODIFIER LETTER CIRCUMFLEX ACCENT " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   374
       "16r0089"    16r2030 " PER MILLE SIGN " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   375
       "16r008A"    16r0160 " LATIN CAPITAL LETTER S WITH CARON " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   376
       "16r008B"    16r2039 " SINGLE LEFT-POINTING ANGLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   377
       "16r008C"    16r0152 " LATIN CAPITAL LIGATURE OE " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   378
       "16r008D"    16r0000 " invalid " 
22583
879bd9713cb9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22501
diff changeset
   379
       "16r008E"    16r017D " LATIN CAPITAL Z WITH INVERSE CARON" 
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   380
       "16r008F"    16r0000 " invalid " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   381
       "16r0090"    16r0000 " invalid " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   382
       "16r0091"    16r2018 " LEFT SINGLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   383
       "16r0092"    16r2019 " RIGHT SINGLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   384
       "16r0093"    16r201C " LEFT DOUBLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   385
       "16r0094"    16r201D " RIGHT DOUBLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   386
       "16r0095"    16r2022 " BULLET " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   387
       "16r0096"    16r2013 " EN DASH " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   388
       "16r0097"    16r2014 " EM DASH " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   389
       "16r0098"    16r02DC " SMALL TILDE " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   390
       "16r0099"    16r2122 " TRADE MARK SIGN " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   391
       "16r009A"    16r0161 " LATIN SMALL LETTER S WITH CARON " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   392
       "16r009B"    16r203A " SINGLE RIGHT-POINTING ANGLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   393
       "16r009C"    16r0153 " LATIN SMALL LIGATURE OE " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   394
       "16r009D"    16r0000 " invalid " 
22583
879bd9713cb9 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 22501
diff changeset
   395
       "16r009E"    16r017E " LATIN SMALL LETTER Z WITH INVERSE CARON " 
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   396
       "16r009F"    16r0178 " LATIN CAPITAL LETTER Y WITH DIAERESIS " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   397
       ) at:(code - 16r7F).
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   398
    t == 0 ifFalse:[^ t].
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   399
    ^ self decodingError.
11000
2cc8e7ba3be6 ms-ansi now treated like unicode
Michael Beyl <mb@exept.de>
parents: 9269
diff changeset
   400
14203
b19842b57af5 changed:
Claus Gittinger <cg@exept.de>
parents: 11000
diff changeset
   401
    "Modified (format): / 12-07-2012 / 14:06:56 / cg"
8139
5968d9ac107e MS-ANSI
Claus Gittinger <cg@exept.de>
parents: 8114
diff changeset
   402
!
5968d9ac107e MS-ANSI
Claus Gittinger <cg@exept.de>
parents: 8114
diff changeset
   403
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   404
decodeString:anEncodedStringOrByteCollection
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   405
    "given a string in my encoding, return a unicode-string for it"
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   406
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   407
    |newString myCode code bits size "{ Class:SmallInteger }"|
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   408
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   409
    size := anEncodedStringOrByteCollection size.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   410
    newString := String new:size.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   411
    bits := newString bitsPerCharacter.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   412
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   413
    1 to:size do:[:idx |
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   414
        code := (anEncodedStringOrByteCollection at:idx) codePoint.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   415
        myCode := self decode:code.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   416
        myCode > 16rFF ifTrue:[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   417
            myCode > 16rFFFF ifTrue:[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   418
                bits < 32 ifTrue:[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   419
                    newString := Unicode32String fromString:newString.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   420
                    bits := 32.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   421
                ]
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   422
            ] ifFalse:[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   423
                bits < 16 ifTrue:[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   424
                    newString := Unicode16String fromString:newString.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   425
                    bits := 16.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   426
                ]
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   427
            ]
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   428
        ].
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   429
        newString at:idx put:(Character codePoint:myCode).
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   430
    ].
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   431
    ^ newString
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   432
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   433
    "
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   434
     CharacterEncoderImplementations::ISO8859_1 decodeString:'hello'
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   435
    "
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   436
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   437
    "Created: / 16-01-2018 / 19:54:02 / stefan"
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   438
    "Modified (format): / 17-01-2018 / 16:30:59 / stefan"
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   439
!
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   440
8139
5968d9ac107e MS-ANSI
Claus Gittinger <cg@exept.de>
parents: 8114
diff changeset
   441
encode:unicodeArg
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   442
    |unicode "{ Class: SmallInteger }" t|
8139
5968d9ac107e MS-ANSI
Claus Gittinger <cg@exept.de>
parents: 8114
diff changeset
   443
22585
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   444
    "/ the comment in mh... is not correct.
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   445
    false ifTrue:[
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   446
        "/ mh - it seems that microsoft has fixed ms-ansi to be unicode compatible
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   447
        "/ with XP, Vista etc.
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   448
        "/ as W95 is not supported anyhow, simply return identity here...
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   449
        ^ unicodeArg.
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   450
    ].
11000
2cc8e7ba3be6 ms-ansi now treated like unicode
Michael Beyl <mb@exept.de>
parents: 9269
diff changeset
   451
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   452
    "we map unicode chars to CP1252 where a mapping exists.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   453
     If no mapping exists, we keep the unicode char"
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   454
14205
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   455
    unicode := unicodeArg.
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   456
    unicode > 16r2122 ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   457
        ^ unicode.
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   458
    ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   459
    unicode <= 16r151 ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   460
        ^ unicode
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   461
    ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   462
    unicode <= 16r2DC ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   463
        unicode <= 16r192 ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   464
            unicode <= 16r178 ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   465
                unicode <= 16r161 ifTrue:[
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   466
                    t := #[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   467
                       "16r0152"    16r8C " LATIN CAPITAL LIGATURE OE " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   468
                       "16r0153"    16r9C " LATIN SMALL LIGATURE OE " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   469
                       "16r0154"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   470
                       "16r0155"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   471
                       "16r0156"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   472
                       "16r0157"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   473
                       "16r0158"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   474
                       "16r0159"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   475
                       "16r015A"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   476
                       "16r015B"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   477
                       "16r015C"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   478
                       "16r015D"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   479
                       "16r015E"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   480
                       "16r015F"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   481
                       "16r0160"    16r8A " LATIN CAPITAL LETTER S WITH CARON " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   482
                       "16r0161"    16r9A " LATIN SMALL LETTER S WITH CARON " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   483
                       ] at:(unicode - 16r151).
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   484
                    t == 0 ifFalse:[^ t].
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   485
                    ^ unicode
14205
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   486
                ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   487
                unicode <= 16r177 ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   488
                    ^ unicode
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   489
                ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   490
                ^  "16r0178" 16r009F " LATIN CAPITAL LETTER Y WITH DIAERESIS " 
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   491
            ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   492
            unicode <= 16r191 ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   493
                ^ unicode
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   494
            ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   495
            ^  "16r0192" 16r0083 " LATIN SMALL LETTER F WITH HOOK " 
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   496
        ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   497
        unicode <= 16r2C5 ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   498
            ^ unicode
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   499
        ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   500
        unicode == 16r2C6 ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   501
            ^  "16r02C6" 16r0088 " MODIFIER LETTER CIRCUMFLEX ACCENT " 
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   502
        ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   503
        unicode <= 16r2DB ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   504
            ^ unicode
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   505
        ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   506
        ^  "16r02DC" 16r0098 " SMALL TILDE " 
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   507
    ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   508
    unicode <= 16r2012 ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   509
        ^ unicode
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   510
    ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   511
    unicode <= 16r203A ifTrue:[
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   512
        t := #(
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   513
           "16r2013"    16r2013 "16r96" " EN DASH " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   514
           "16r2014"    16r2014 "16r97" " EM DASH " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   515
           "16r2015"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   516
           "16r2016"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   517
           "16r2017"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   518
           "16r2018"    16r91 " LEFT SINGLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   519
           "16r2019"    16r92 " RIGHT SINGLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   520
           "16r201A"    16r82 " SINGLE LOW-9 QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   521
           "16r201B"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   522
           "16r201C"    16r93 " LEFT DOUBLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   523
           "16r201D"    16r94 " RIGHT DOUBLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   524
           "16r201E"    16r84 " DOUBLE LOW-9 QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   525
           "16r201F"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   526
           "16r2020"    16r86 " DAGGER " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   527
           "16r2021"    16r87 " DOUBLE DAGGER " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   528
           "16r2022"    16r95 " BULLET " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   529
           "16r2023"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   530
           "16r2024"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   531
           "16r2025"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   532
           "16r2026"    16r85 " HORIZONTAL ELLIPSIS " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   533
           "16r2027"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   534
           "16r2028"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   535
           "16r2029"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   536
           "16r202A"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   537
           "16r202B"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   538
           "16r202C"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   539
           "16r202D"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   540
           "16r202E"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   541
           "16r202F"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   542
           "16r2030"    16r89 " PER MILLE SIGN " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   543
           "16r2031"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   544
           "16r2032"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   545
           "16r2033"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   546
           "16r2034"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   547
           "16r2035"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   548
           "16r2036"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   549
           "16r2037"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   550
           "16r2038"    16r00 " keep unicode " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   551
           "16r2039"    16r8B " SINGLE LEFT-POINTING ANGLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   552
           "16r203A"    16r9B " SINGLE RIGHT-POINTING ANGLE QUOTATION MARK " 
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   553
           ) at:(unicode - 16r2012).
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   554
        t == 0 ifFalse:[^ t].
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   555
        ^ unicode
14205
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   556
    ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   557
"/    unicode = 16r20AC ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   558
"/        ^ 16r0080 " EURO character "
11000
2cc8e7ba3be6 ms-ansi now treated like unicode
Michael Beyl <mb@exept.de>
parents: 9269
diff changeset
   559
"/    ].
14205
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   560
    unicode <= 16r2121 ifTrue:[
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   561
        ^ unicode
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   562
    ].
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   563
    ^  "16r2122" 16r0099 " TRADE MARK SIGN "
14203
b19842b57af5 changed:
Claus Gittinger <cg@exept.de>
parents: 11000
diff changeset
   564
14205
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   565
    "Modified: / 12-07-2012 / 14:46:59 / cg"
9269
f629c9eafec6 speedup encoding of long strings when no 8 bit chars are present
Claus Gittinger <cg@exept.de>
parents: 8813
diff changeset
   566
!
f629c9eafec6 speedup encoding of long strings when no 8 bit chars are present
Claus Gittinger <cg@exept.de>
parents: 8813
diff changeset
   567
f629c9eafec6 speedup encoding of long strings when no 8 bit chars are present
Claus Gittinger <cg@exept.de>
parents: 8813
diff changeset
   568
encodeString:aStringOrUnicodeString
f629c9eafec6 speedup encoding of long strings when no 8 bit chars are present
Claus Gittinger <cg@exept.de>
parents: 8813
diff changeset
   569
    "redefined to speedup simple 8 bit strings"
f629c9eafec6 speedup encoding of long strings when no 8 bit chars are present
Claus Gittinger <cg@exept.de>
parents: 8813
diff changeset
   570
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   571
    |newString myCode bits size "{ Class:SmallInteger }"|
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   572
22585
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   573
    "/ the comment in mh... is not correct.
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   574
    false ifTrue:[
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   575
        "/ mh - it seems that microsoft has fixed ms-ansi to be unicode compatible
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   576
        "/ with XP, Vista etc.
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   577
        "/ as W95 is not supported anyhow, simply return identity here...
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   578
        ^ aStringOrUnicodeString.
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   579
    ].
11000
2cc8e7ba3be6 ms-ansi now treated like unicode
Michael Beyl <mb@exept.de>
parents: 9269
diff changeset
   580
18602
cf5b0713b748 class: CharacterEncoderImplementations::MS_Ansi
Stefan Vogel <sv@exept.de>
parents: 17624
diff changeset
   581
    "/ all between 0 and 7F ?
cf5b0713b748 class: CharacterEncoderImplementations::MS_Ansi
Stefan Vogel <sv@exept.de>
parents: 17624
diff changeset
   582
    (aStringOrUnicodeString containsNon7BitAscii) ifFalse:[
cf5b0713b748 class: CharacterEncoderImplementations::MS_Ansi
Stefan Vogel <sv@exept.de>
parents: 17624
diff changeset
   583
         ^ aStringOrUnicodeString asSingleByteString.
14205
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   584
    ].
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   585
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   586
    size := aStringOrUnicodeString size.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   587
    newString := String new:size.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   588
    bits := newString bitsPerCharacter.
14203
b19842b57af5 changed:
Claus Gittinger <cg@exept.de>
parents: 11000
diff changeset
   589
22501
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   590
    1 to:size do:[:idx |
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   591
        myCode := self encode:((aStringOrUnicodeString at:idx) codePoint).
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   592
        myCode > 16rFF ifTrue:[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   593
            myCode > 16rFFFF ifTrue:[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   594
                bits < 32 ifTrue:[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   595
                    newString := Unicode32String fromString:newString.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   596
                    bits := 32.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   597
                ]
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   598
            ] ifFalse:[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   599
                bits < 16 ifTrue:[
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   600
                    newString := Unicode16String fromString:newString.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   601
                    bits := 16.
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   602
                ]
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   603
            ]
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   604
        ].
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   605
        newString at:idx put:(Character codePoint:myCode).
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   606
    ].
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   607
    ^ newString
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   608
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   609
    "Created: / 16-01-2018 / 19:53:33 / stefan"
93981acbcba3 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 18602
diff changeset
   610
    "Modified: / 17-01-2018 / 14:15:39 / stefan"
8139
5968d9ac107e MS-ANSI
Claus Gittinger <cg@exept.de>
parents: 8114
diff changeset
   611
! !
5968d9ac107e MS-ANSI
Claus Gittinger <cg@exept.de>
parents: 8114
diff changeset
   612
22585
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   613
!MS_Ansi methodsFor:'queries'!
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   614
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   615
characterSize:charOrCodePoint
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   616
    "return the number of bytes required to encode codePoint"
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   617
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   618
    |code|
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   619
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   620
    code := self encode:charOrCodePoint asInteger.
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   621
    code <= 16rFF ifTrue:[^ 1].
22589
a54279da036e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22585
diff changeset
   622
    ^ 2
22585
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   623
! !
cae54b54d329 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 22583
diff changeset
   624
8081
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
!MS_Ansi class methodsFor:'documentation'!
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
version
18602
cf5b0713b748 class: CharacterEncoderImplementations::MS_Ansi
Stefan Vogel <sv@exept.de>
parents: 17624
diff changeset
   628
    ^ '$Header$'
14205
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   629
!
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   630
3bb27b21d36e changed:
Claus Gittinger <cg@exept.de>
parents: 14203
diff changeset
   631
version_CVS
18602
cf5b0713b748 class: CharacterEncoderImplementations::MS_Ansi
Stefan Vogel <sv@exept.de>
parents: 17624
diff changeset
   632
    ^ '$Header$'
8081
b468050174a9 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   633
! !
17624
acb2e49fb3ab class: CharacterEncoderImplementations::MS_Ansi
Stefan Vogel <sv@exept.de>
parents: 14560
diff changeset
   634