[Helma-user] changing encoding for helma.File
Hannes Wallnoefer
hannes at helma.at
Tue Jan 8 11:51:00 CET 2008
Hi Anton,
2008/1/8, Anton Pirker <helma at gmiatlich.net>:
> Hello List!
>
> I am reading textfiles with readln() from helma.File().
> The Problem is, that the textfiles are in utf8. I tried to change the
> encoding in app.properties with
> charset = UTF-8 (and charset = UTF8, i am never sure wich one it is)
Both should work. Java has canonical names and aliases for encodings.
I can't find a list of aliases anymore, and freakingly the canonical
names are different depending on which java package you are using:
http://java.sun.com/javase/6/docs/technotes/guides/intl/encoding.doc.html
> But no mather what i tried, the words look like scrambled eggs.
> In helma.File() i found out, that javas FileReader() is used to read the
> file, which uses the default encoding. There is no chance to change the
> encoding.
>
> How can i read utf8-files?
IMO the helma.File constructor should take a second optional parameter
for the encoding. As I said before, helma.File really needs some
polish. I think we should tackle this for helma 1.7.
hannes
More information about the Helma-user
mailing list