<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"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></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>>to:<br>
<br>
=============== Diff against Collections-fbs.526 ===============<br>
<br>
Item was changed:<br>
----- Method: Base64MimeConverter class>>initialize (in category 'as yet unclassified') -----<br>
initialize<br>
<br>
FromCharTable := Array new: 256. "nils"<br>
+ ToCharTable := ($A to: $Z) , ($a to: $z) , ($0 to: $9) , '+/'.<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>>initializeClassificationTable (in category 'class initialization') -----<br>
initializeClassificationTable<br>
"<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>
"<br>
| ch1 |<br>
<br>
LowercaseBit := 1 bitShift: 16.<br>
UppercaseBit := 1 bitShift: 17.<br>
<br>
"Initialize the letter bits (e.g., isLetter == true)"<br>
LetterBits := LowercaseBit bitOr: UppercaseBit.<br>
<br>
ClassificationTable := Array new: 256.<br>
"Initialize the defaults (neither lower nor upper case)"<br>
0 to: 255 do:[:i|<br>
ClassificationTable at: i+1 put: (i bitShift: 8) + i.<br>
].<br>
<br>
"Initialize character pairs (upper-lower case)"<br>
#(<br>
"Basic roman"<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>
"International"<br>
+ ($Ä $ä) ($Å $å) ($Ç $ç) ($É $é)<br>
+ ($Ñ $ñ) ($Ö $ö) ($Ü $ü) ($À $à)<br>
+ ($à $ã) ($Õ $õ) ($Œ $œ) ($Æ $æ)<br>
- ($Ä $ä) ($Å $å) ($Ç $ç) ($É $é)<br>
- ($Ñ $ñ) ($Ö $ö) ($Ü $ü) ($À $à)<br>
- ($à $ã) ($Õ $õ) ($Œ $œ) ($Æ $æ)<br>
"International - Spanish"<br>
+ ($Á $á) ($Í $í) ($Ó $ó) ($Ú $ú)<br>
- ($Á $á) ($Í $í) ($Ó $ó) ($Ú $ú)<br>
"International - PLEASE CHECK"<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>
"Initialize a few others for which we only have lower case versions."<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>>asCharacter (in category 'converting') -----<br>
asCharacter<br>
"Answer the receiver's first character, or '*' if none. Idiosyncratic, provisional."<br>
<br>
+ ^ self size > 0 ifTrue: [self first] ifFalse:[$·]!<br>
- ^ self size > 0 ifTrue: [self first] ifFalse:[$·]!<br>
<br>
Item was changed:<br>
----- Method: Text>>printStringHtml:on: (in category 'html') -----<br>
printStringHtml: aString on: aStream<br>
| html |<br>
html := aString.<br>
""<br>
html := html copyReplaceAll: '&' with: '&amp;'.<br>
html := html copyReplaceAll: '>' with: '&gt;'.<br>
html := html copyReplaceAll: '<' with: '&lt;'.<br>
""<br>
+ html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬®¬¨¦Ö' with: '&aacute;'.<br>
+ html := html copyReplaceAll: '¬¨¬Ž¬¨¬©' with: '&eacute;'.<br>
+ html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬®¬¶¦ë' with: '&iacute;'.<br>
+ html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬®¬¶¦ü' with: '&oacute;'.<br>
+ html := html copyReplaceAll: '¬¨¬Ž¬¨¦š' with: '&uacute;'.<br>
+ html := html copyReplaceAll: '¬¨¬Ž¬¨¬±' with: '&ntilde;'.<br>
- html := html copyReplaceAll: '�������鬨�����Ö' with: '&aacute;'.<br>
- html := html copyReplaceAll: '�������鬨�����©' with: '&eacute;'.<br>
- html := html copyReplaceAll: '�������鬨�����ë' with: '&iacute;'.<br>
- html := html copyReplaceAll: '�������鬨�����ü' with: '&oacute;'.<br>
- html := html copyReplaceAll: '�������鬨�����ö' with: '&uacute;'.<br>
- html := html copyReplaceAll: '�������鬨�����±' with: '&ntilde;'.<br>
""<br>
+ html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¶¦±' with: '&Aacute;'.<br>
+ html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¨¬¢' with: '&Eacute;'.<br>
+ html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¶¦º' with: '&Iacute;'.<br>
+ html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¨¬Æ' with: '&Oacute;'.<br>
+ html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¨¦©' with: '&Uacute;'.<br>
+ html := html copyReplaceAll: '¬¨¬®¬¨¬é¬¨¬Ž¬¨¬·' with: '&Ntilde;'.<br>
- html := html copyReplaceAll: '�������鬨�����±' with: '&Aacute;'.<br>
- html := html copyReplaceAll: '�������鬨�����¢' with: '&Eacute;'.<br>
- html := html copyReplaceAll: '�������鬨�����º' with: '&Iacute;'.<br>
- html := html copyReplaceAll: '�������鬨�����Æ' with: '&Oacute;'.<br>
- html := html copyReplaceAll: '�������鬨�����©' with: '&Uacute;'.<br>
- html := html copyReplaceAll: '�������鬨�����·' with: '&Ntilde;'.<br>
""<br>
html := html copyReplaceAll: '<br>
' with: '<br><br>
'.<br>
html := html copyReplaceAll: ' ' with: '&nbsp;&nbsp;&nbsp;&nbsp;'.<br>
""<br>
aStream nextPutAll: html!<br>
<br>
<br>
</blockquote></div><br></div>