[Pharo-users] Codepage 437
Sven Van Caekenberghe
sven at stfx.eu
Tue Oct 20 12:38:11 EDT 2015
I added the following:
Time: 20 October 2015, 6:35:23.106957 pm
Introduction of ZnByteEncoder class>>#newFromUrl:
Refactoring introduced #top123FromUnicodeSpec:
Time: 20 October 2015, 6:36:04.004228 pm
So now you can do
ZnByteEncoder newFromUrl: 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP437.TXT'.
But you better cache that instance somewhere.
On 20 Oct 2015, at 16:07, stepharo <stepharo at free.fr> wrote:
> You rock sven!
> Le 20/10/15 14:22, Sven Van Caekenberghe a écrit :
>>> 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?
>> 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
More information about the Pharo-users