[Pharo-users] Codepage 437

stepharo stepharo at free.fr
Tue Oct 20 10:07:14 EDT 2015


Excellent!
You rock sven!

Le 20/10/15 14:22, Sven Van Caekenberghe a écrit :
> Norbert,
>
>> On 20 Oct 2015, at 14:11, Norbert Hartl <norbert at hartl.name> wrote:
>>
>> Is there any way to read a codepage 437 encoded file with pharo?
>>
>> thanks,
>>
>> Norbert
> This could be done with ZnByteEncoder, but that encoding is not provided by default. So you need to generate a new mapping method, luckily this can be done automagically:
>
> ZnByteEncoder generateByteToUnicodeSpec: 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP437.TXT'.
>
> Put it on the class side and plug it in #mappingToIdentifiers and #initialize again. I guess you maybe could provide a one-shot instance, but I have never done that and adding it as known encoding will be easier at first.
>
> I am sure you will figure it out ;-)
>
> Let me know how it goes, maybe it would be a good idea to allow one-shot encoder instances based just on a spec from unicode.org
>
> Sven
>
>
>





More information about the Pharo-users mailing list