CharacterEncoder.st
changeset 8904 d358f0a17f07
parent 8856 cb0a15744854
child 9064 866d6d41afa9
equal deleted inserted replaced
8903:4e15c297fadc 8904:d358f0a17f07
   222      self encoderFor:#'koi8-r'      
   222      self encoderFor:#'koi8-r'      
   223      self encoderFor:#'koi8-u'      
   223      self encoderFor:#'koi8-u'      
   224      self encoderFor:#'jis0208'      
   224      self encoderFor:#'jis0208'      
   225      self encoderFor:#'jis7'      
   225      self encoderFor:#'jis7'      
   226      self encoderFor:#'utf8'      
   226      self encoderFor:#'utf8'      
       
   227      (self encoderFor:#'utf16le') encode:'hello'      
       
   228      self encoderFor:#'utf16be'      
   227     "
   229     "
   228 !
   230 !
   229 
   231 
   230 encoderFor:encodingNameSymbolArg ifAbsent:exceptionValue
   232 encoderFor:encodingNameSymbolArg ifAbsent:exceptionValue
   231     "given the name of an encoding, return an encoder-instance which can map these from/into unicode."
   233     "given the name of an encoding, return an encoder-instance which can map these from/into unicode."
   531         (HANGUL             unicode     ( 'hangul' ))
   533         (HANGUL             unicode     ( 'hangul' ))
   532 
   534 
   533         (ISO10646_1         unicode     ( unicode 'iso10646_1' 'iso10646-1' 'iso-10646-1' ))
   535         (ISO10646_1         unicode     ( unicode 'iso10646_1' 'iso10646-1' 'iso-10646-1' ))
   534 
   536 
   535         (ISO10646_to_UTF8   unicode     ( utf8 'utf-8' ))
   537         (ISO10646_to_UTF8   unicode     ( utf8 'utf-8' ))
       
   538         (ISO10646_to_UTF16BE unicode    ( utf16b utf16be 'utf-16b' 'utf-16be' ))
       
   539         (ISO10646_to_UTF16LE unicode    ( utf16l utf16le 'utf-16e' 'utf-16le' ))
   536 
   540 
   537         (ISO8859_1          unicode     ( 'iso8859_1' 'iso8859-1' 'iso-8859-1' 'latin-1' 'latin1' 'iso-ir-100' 'ibm-819' 'ms-cp819' 'ibm-cp819' 'iso8859'))
   541         (ISO8859_1          unicode     ( 'iso8859_1' 'iso8859-1' 'iso-8859-1' 'latin-1' 'latin1' 'iso-ir-100' 'ibm-819' 'ms-cp819' 'ibm-cp819' 'iso8859'))
   538 
   542 
   539         (ISO8859_2          unicode     ( 'iso8859_2' 'iso8859-2' 'iso-8859-2' 'latin2' 'latin-2' 'iso-ir-101'))
   543         (ISO8859_2          unicode     ( 'iso8859_2' 'iso8859-2' 'iso-8859-2' 'latin2' 'latin-2' 'iso-ir-101'))
   540 
   544 
   926      the second contains a user-readable string (description).
   930      the second contains a user-readable string (description).
   927      More than one external name may be mapped onto the same symbolic."
   931      More than one external name may be mapped onto the same symbolic."
   928 
   932 
   929     ^ #( 
   933     ^ #( 
   930          ('utf8'        'Unicode as 8Bit characters'    )  
   934          ('utf8'        'Unicode as 8Bit characters'    )  
       
   935          ('utf16BE'     'Unicode as 16Bit big-endian'    )  
       
   936          ('utf16LE'     'Unicode as 16Bit little-endian' )  
   931 "/         ('utf7'        'Unicode as 7Bit characters'    ) 
   937 "/         ('utf7'        'Unicode as 7Bit characters'    ) 
   932 "/       nil
   938 "/       nil
   933          ('ascii'       'Common 7bit subset of iso8859' )
   939          ('ascii'       'Common 7bit subset of iso8859' )
   934          ('iso8859-1'   'Latin1'                        )
   940          ('iso8859-1'   'Latin1'                        )
   935          ('iso8859-2'   'Latin2'                        )
   941          ('iso8859-2'   'Latin2'                        )
  1500 ! !
  1506 ! !
  1501 
  1507 
  1502 !CharacterEncoder class methodsFor:'documentation'!
  1508 !CharacterEncoder class methodsFor:'documentation'!
  1503 
  1509 
  1504 version
  1510 version
  1505     ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.92 2005-04-20 00:47:50 cg Exp $'
  1511     ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoder.st,v 1.93 2005-07-07 17:36:58 cg Exp $'
  1506 ! !
  1512 ! !
  1507 
  1513 
  1508 CharacterEncoder initialize!
  1514 CharacterEncoder initialize!