CharacterArray.st
changeset 23400 d931839b8ce0
parent 23392 224ad96ff678
child 23428 9a1a7a4b8bfb
equal deleted inserted replaced
23399:59fecf156230 23400:d931839b8ce0
   390     encodedSize := aStringOrByteCollection size.
   390     encodedSize := aStringOrByteCollection size.
   391     decodedSize := aStringOrByteCollection utf8DecodedSize.
   391     decodedSize := aStringOrByteCollection utf8DecodedSize.
   392     
   392     
   393     encodedSize == decodedSize ifTrue:[
   393     encodedSize == decodedSize ifTrue:[
   394         "/ fast track, also avoid creation of new strings if aStringOrByteCollection is already a 7-bit string
   394         "/ fast track, also avoid creation of new strings if aStringOrByteCollection is already a 7-bit string
   395         ^ aStringOrByteCollection asSingleByteString
   395         ^ aStringOrByteCollection asSingleByteStringIfPossible
   396     ].
   396     ].
   397 
   397 
   398     nBitsRequired := 8.
   398     nBitsRequired := 8.
   399     srcIdx := 1.
   399     srcIdx := 1.
   400 
   400 
   526      CharacterArray decodeFromUTF8:#[ 16rE0 16r80 16r80 ]
   526      CharacterArray decodeFromUTF8:#[ 16rE0 16r80 16r80 ]
   527      CharacterArray decodeFromUTF8:#[ 16rE0 16r81 16r02 ]
   527      CharacterArray decodeFromUTF8:#[ 16rE0 16r81 16r02 ]
   528     "
   528     "
   529 
   529 
   530     "Modified: / 07-02-2017 / 17:41:17 / stefan"
   530     "Modified: / 07-02-2017 / 17:41:17 / stefan"
       
   531     "Modified: / 04-10-2018 / 13:29:53 / Claus Gittinger"
   531 !
   532 !
   532 
   533 
   533 setupNormalizationMaps
   534 setupNormalizationMaps
   534     "returns a 2-stage map from ch2 -> ch1 -> mappedChar.
   535     "returns a 2-stage map from ch2 -> ch1 -> mappedChar.
   535      for unicode normalization 
   536      for unicode normalization 
  1059      String withoutAmpersandEscapes:'&&a&&b&&c&&d&'
  1060      String withoutAmpersandEscapes:'&&a&&b&&c&&d&'
  1060      String withoutAmpersandEscapes:'&a&&b&&c&&d&'
  1061      String withoutAmpersandEscapes:'&a&&b&&c&&d&'
  1061      String withoutAmpersandEscapes:'a&&b&&c&&d'
  1062      String withoutAmpersandEscapes:'a&&b&&c&&d'
  1062     "
  1063     "
  1063 ! !
  1064 ! !
       
  1065 
  1064 
  1066 
  1065 !CharacterArray methodsFor:'Compatibility-ANSI'!
  1067 !CharacterArray methodsFor:'Compatibility-ANSI'!
  1066 
  1068 
  1067 addLineDelimiters
  1069 addLineDelimiters
  1068     "Ansi compatibility - same as withCRs"
  1070     "Ansi compatibility - same as withCRs"