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