[squeak-dev] The Trunk: Collections-nice.527.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Tue Jul 30 01:17:26 UTC 2013


Hmm it looks like some UTF8 mess
I did only change Base64MimeConverter... Did I break it?


2013/7/30 <commits at source.squeak.org>

> Nicolas Cellier uploaded a new version of Collections to project The Trunk:
> http://source.squeak.org/trunk/Collections-nice.527.mcz
>
> ==================== Summary ====================
>
> Name: Collections-nice.527
> Author: nice
> Time: 30 July 2013, 2:13:07.506 am
> UUID: 17e38fb5-76dd-499b-aa6d-bfe07045c28d
> Ancestors: Collections-fbs.526
>
> Simplify Base64MimeConverter class initialization with Character>>to:
>
> =============== Diff against Collections-fbs.526 ===============
>
> Item was changed:
>   ----- Method: Base64MimeConverter class>>initialize (in category 'as yet
> unclassified') -----
>   initialize
>
>         FromCharTable := Array new: 256.        "nils"
> +       ToCharTable := ($A to: $Z) , ($a to: $z) , ($0 to: $9) , '+/'.
> +       ToCharTable keysAndValuesDo: [:ind :char |
> +               FromCharTable at: char asciiValue + 1 put: ind - 1].!
> -       ToCharTable := Array new: 64.
> -       ($A asciiValue to: $Z asciiValue) doWithIndex: [:val :ind |
> -               FromCharTable at: val+1 put: ind-1.
> -               ToCharTable at: ind put: val asCharacter].
> -       ($a asciiValue to: $z asciiValue) doWithIndex: [:val :ind |
> -               FromCharTable at: val+1 put: ind+25.
> -               ToCharTable at: ind+26 put: val asCharacter].
> -       ($0 asciiValue to: $9 asciiValue) doWithIndex: [:val :ind |
> -               FromCharTable at: val+1 put: ind+25+26.
> -               ToCharTable at: ind+26+26 put: val asCharacter].
> -       FromCharTable at: $+ asciiValue + 1 put: 62.
> -       ToCharTable at: 63 put: $+.
> -       FromCharTable at: $/ asciiValue + 1 put: 63.
> -       ToCharTable at: 64 put: $/.
> -       !
>
> Item was changed:
>   ----- Method: Character class>>initializeClassificationTable (in
> category 'class initialization') -----
>   initializeClassificationTable
>         "
>         Initialize the classification table. The classification table is a
>         compact encoding of upper and lower cases of characters with
>
>                 - bits 0-7: The lower case value of this character.
>                 - bits 8-15: The upper case value of this character.
>                 - bit 16: lowercase bit (e.g., isLowercase == true)
>                 - bit 17: uppercase bit (e.g., isUppercase == true)
>
>         "
>         | ch1 |
>
>         LowercaseBit := 1 bitShift: 16.
>         UppercaseBit := 1 bitShift: 17.
>
>         "Initialize the letter bits (e.g., isLetter == true)"
>         LetterBits := LowercaseBit bitOr: UppercaseBit.
>
>         ClassificationTable := Array new: 256.
>         "Initialize the defaults (neither lower nor upper case)"
>         0 to: 255 do:[:i|
>                 ClassificationTable at: i+1 put: (i bitShift: 8) + i.
>         ].
>
>         "Initialize character pairs (upper-lower case)"
>         #(
>                 "Basic roman"
>                 ($A $a)         ($B $b)         ($C $c)         ($D $d)
>                 ($E $e)         ($F $f)         ($G $g)         ($H $h)
>                 ($I $i)                 ($J $j)                 ($K $k)
>       ($L $l)
>                 ($M $m) ($N $n) ($O $o) ($P $p)
>                 ($Q $q)         ($R $r)         ($S $s)         ($T $t)
>                 ($U $u) ($V $v) ($W $w) ($X $x)
>                 ($Y $y) ($Z $z)
>                 "International"
> +               ($Ä $ä) ($Å $å) ($Ç $ç) ($É $é)
> +               ($Ñ $ñ) ($Ö $ö) ($Ü $ü) ($À $à)
> +               ($à $ã) ($Õ $õ) ($Œ $œ) ($Æ $æ)
> -               ($Ä $ä) ($Å $å) ($Ç $ç) ($É $é)
> -               ($Ñ $ñ) ($Ö $ö) ($Ü $ü) ($À $à)
> -               ($à $ã) ($Õ $õ) ($Œ $œ) ($Æ $æ)
>                 "International - Spanish"
> +               ($Á $á) ($Í $í)         ($Ó $ó) ($Ú $ú)
> -               ($Á $á) ($Í $í)         ($Ó $ó) ($Ú $ú)
>                 "International - PLEASE CHECK"
> +               ($È $è) ($Ì $ì)         ($Ò $ò) ($Ù $ù)
> +               ($Ë $ë) ($Ï $ï)
> +               ($Â $â) ($Ê $ê) ($Î $î) ($Ô $ô) ($Û $û)
> -               ($È $è) ($Ì $ì)         ($Ò $ò) ($Ù $ù)
> -               ($Ë $ë) ($Ï $ï)
> -               ($Â $â) ($Ê $ê) ($Î $î) ($Ô $ô) ($Û $û)
>         ) do:[:pair| | ch2 |
>                 ch1 := pair first asciiValue.
>                 ch2 := pair last asciiValue.
>                 ClassificationTable at: ch1+1 put: (ch1 bitShift: 8) + ch2
> + UppercaseBit.
>                 ClassificationTable at: ch2+1 put: (ch1 bitShift: 8) + ch2
> + LowercaseBit.
>         ].
>
>         "Initialize a few others for which we only have lower case
> versions."
> +       #($ß $Ø $ø $ÿ) do:[:char|
> -       #($ß $Ø $ø $ÿ) do:[:char|
>                 ch1 := char asciiValue.
>                 ClassificationTable at: ch1+1 put: (ch1 bitShift: 8) + ch1
> + LowercaseBit.
>         ].
>   !
>
> Item was changed:
>   ----- Method: String>>asCharacter (in category 'converting') -----
>   asCharacter
>         "Answer the receiver's first character, or '*' if none.
>  Idiosyncratic, provisional."
>
> +       ^ self size > 0 ifTrue: [self first] ifFalse:[$·]!
> -       ^ self size > 0 ifTrue: [self first] ifFalse:[$·]!
>
> Item was changed:
>   ----- Method: Text>>printStringHtml:on: (in category 'html') -----
>   printStringHtml: aString on: aStream
>         | html |
>         html := aString.
>         ""
>         html := html copyReplaceAll: '&' with: '&amp;'.
>         html := html copyReplaceAll: '>' with: '&gt;'.
>         html := html copyReplaceAll: '<' with: '&lt;'.
>         ""
> +       html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬®¬¨¦Ö' with: '&aacute;'.
> +       html := html copyReplaceAll: '¬¨¬Ž¬¨¬©' with: '&eacute;'.
> +       html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬®¬¶¦ë' with: '&iacute;'.
> +       html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬®¬¶¦ü' with: '&oacute;'.
> +       html := html copyReplaceAll: '¬¨¬Ž¬¨¦š' with: '&uacute;'.
> +       html := html copyReplaceAll: '¬¨¬Ž¬¨¬±' with: '&ntilde;'.
> -       html := html copyReplaceAll: '�������鬨�����Ö' with: '&aacute;'.
> -       html := html copyReplaceAll: '�������鬨�����©' with: '&eacute;'.
> -       html := html copyReplaceAll: '�������鬨�����ë' with: '&iacute;'.
> -       html := html copyReplaceAll: '�������鬨�����ü' with: '&oacute;'.
> -       html := html copyReplaceAll: '�������鬨�����ö' with: '&uacute;'.
> -       html := html copyReplaceAll: '�������鬨�����±' with: '&ntilde;'.
>         ""
> +       html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¶¦±' with: '&Aacute;'.
> +       html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¨¬¢' with: '&Eacute;'.
> +       html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¶¦º' with: '&Iacute;'.
> +       html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¨¬Æ' with: '&Oacute;'.
> +       html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¨¦©' with: '&Uacute;'.
> +       html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¨¬·' with: '&Ntilde;'.
> -       html := html copyReplaceAll: '�������鬨�����±' with: '&Aacute;'.
> -       html := html copyReplaceAll: '�������鬨�����¢' with: '&Eacute;'.
> -       html := html copyReplaceAll: '�������鬨�����º' with: '&Iacute;'.
> -       html := html copyReplaceAll: '�������鬨�����Æ' with: '&Oacute;'.
> -       html := html copyReplaceAll: '�������鬨�����©' with: '&Uacute;'.
> -       html := html copyReplaceAll: '�������鬨�����·' with: '&Ntilde;'.
>         ""
>         html := html copyReplaceAll: '
>   ' with: '<br>
>   '.
>         html := html copyReplaceAll: '  ' with: '&nbsp;&nbsp;&nbsp;&nbsp;'.
>         ""
>         aStream nextPutAll: html!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130730/01692d47/attachment.htm


More information about the Squeak-dev mailing list