CharacterEncoderImplementations__ISO10646_to_UTF8.st
changeset 22429 48389a135c35
parent 22413 b40bbf08ddd8
child 22474 f42c97c037ed
equal deleted inserted replaced
22428:b4f17397e9c3 22429:48389a135c35
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 2004 by eXept Software AG
     4  COPYRIGHT (c) 2004 by eXept Software AG
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
    65 
    67 
    66 
    68 
    67   Decoding (utf8 to unicode):
    69   Decoding (utf8 to unicode):
    68      |t|
    70      |t|
    69 
    71 
    70      t := ISO10646_to_UTF8 encodeString:'Helloœ'.
    72      t := ISO10646_to_UTF8 encodeString:'Helloœ'.
    71      ISO10646_to_UTF8 decodeString:t.
    73      ISO10646_to_UTF8 decodeString:t.
    72 "
    74 "
    73 ! !
    75 ! !
    74 
    76 
    75 !ISO10646_to_UTF8 class methodsFor:'instance creation'!
    77 !ISO10646_to_UTF8 class methodsFor:'instance creation'!
   172     "Created: / 16-02-2017 / 16:27:31 / stefan"
   174     "Created: / 16-02-2017 / 16:27:31 / stefan"
   173 ! !
   175 ! !
   174 
   176 
   175 !ISO10646_to_UTF8 methodsFor:'queries'!
   177 !ISO10646_to_UTF8 methodsFor:'queries'!
   176 
   178 
   177 characterSize:charOrcodePoint
   179 characterSize:charOrCodePoint
   178     "return the number of bytes required to encode codePoint"
   180     "return the number of bytes required to encode codePoint"
   179 
   181 
   180     ^ charOrcodePoint asCharacter utf8BytesPerCharacter.
   182     ^ charOrCodePoint asCharacter utf8BytesPerCharacter.
   181 
   183 
   182     "Created: / 15-06-2005 / 15:16:22 / janfrog"
   184     "Created: / 15-06-2005 / 15:16:22 / janfrog"
   183     "Modified: / 03-01-2018 / 23:05:59 / stefan"
   185     "Modified: / 03-01-2018 / 23:05:59 / stefan"
   184 !
   186 !
   185 
   187