Ben,

On 19 Mar 2013, at 00:41, Ben Coman <[email protected]> wrote:

> Sven Van Caekenberghe wrote:
>> On 18 Mar 2013, at 17:30, Marcus Denker <[email protected]> wrote:
>> 
>>  
>>> On Mar 18, 2013, at 5:26 PM, LogiqueWerks <[email protected]> wrote:
>>> 
>>>    
>>>> so-desu ...
>>>> 
>>>> Clicked in don't show message again box ...
>>>> 
>>>> But by then I was looking at
>>>> 
>>>>                    (encoding = 'utf-8')                            ifTrue: 
>>>> [^UTF8TextConverter].                           
>>>>                    (encoding = 'shiftjis' or: [ encoding = 'sjis' ]) 
>>>> as seen in JapaneseEnvironment>>systemConverterClass for X11 ... also looks
>>>> a little fragile for lack of accessors yet X11Encoding is just such a
>>>> class-side location for "utf8EncodingCode" or such like ...  
>>>> My other programming environment uses "utf8" as the string. Oi vey. Then
>>>> there are the 'UTF-8' folks out there ...  
>>>> Is there a reason to avoid symbols here ?  Or at least to refactor that
>>>> 
>>>> () or: [] 
>>>> out and into X11Encoding ?
>>>> 
>>>> That call at 2AM on a Sunday morning is Sooo often for similar issues that
>>>> crept past code reviews ... or is this a lighter style that I am used to ?
>>>>      
>>> code quality is very low for most of the old code base…  Improvements are 
>>> always welcome.
>>>    
>> 
>> Check out the ZnCharacterEncoder hierarchy for a much simpler, more modern 
>> implementation of UTF8 and some common byte encoders.
> 
> Is that a candidate to move into core? 

It is permanently in the image.

Pending community testing, feedback, improvement, extension, yes it could 
replace the others.

It is currently used for the HTTP layer, but is fully functional for any stream:

'my-utf8-file.txt' asFileReference readStreamDo: [ :stream |
        stream binary. "remove the old stuff"
        (ZnCharacterReadStream on: stream) upToEnd ].

The key difference is that is works strictly from bytes to/from characters, not 
from character to/from character like the old ones.

Sven

>> It requires people fluent in all kinds of special spoken languages to help 
>> in moving things forward.
>> 
>> What do we really need above UTF8 and some simple byte encoders ?
>> 
>> Sven
>> 
>> --
>> Sven Van Caekenberghe
>> http://stfx.eu
>> Smalltalk is the Red Pill
>> 
>> 
>> 
>>  
> 
> 


Reply via email to