Anton Pirker | 8 Jan 11:19

changing encoding for helma.File

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)

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?

thanks in advance,
Anton
Rainer Rynesch | 8 Jan 11:24
Picon

Re: changing encoding for helma.File


Hello,
 you could change the default encoding 
put
-Dfile.encoding=YOUR_ENCODING
in JAVA_OPTS
in helma.conf

Rainer

> -----Ursprüngliche Nachricht-----
> Von: helma-user-bounces <at> helma.org 
> [mailto:helma-user-bounces <at> helma.org] Im Auftrag von Anton Pirker
> Gesendet: Dienstag, 08. Jänner 2008 11:19
> An: Helma User Mailing List
> Betreff: [Helma-user] changing encoding for helma.File
> 
> 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)
> 
> 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?
(Continue reading)

Anton Pirker | 8 Jan 11:39

Re: changing encoding for helma.File

Hello Rainer!

Rainer Rynesch schrieb:
> 
> Hello,
>  you could change the default encoding 
> put
> -Dfile.encoding=YOUR_ENCODING
> in JAVA_OPTS
> in helma.conf

Thanks for the quick response!

Works like a charm!
Anton

> 
> 
> Rainer
>  
> 
>> -----Ursprüngliche Nachricht-----
>> Von: helma-user-bounces <at> helma.org 
>> [mailto:helma-user-bounces <at> helma.org] Im Auftrag von Anton Pirker
>> Gesendet: Dienstag, 08. Jänner 2008 11:19
>> An: Helma User Mailing List
>> Betreff: [Helma-user] changing encoding for helma.File
>>
>> Hello List!
>>
(Continue reading)

Hannes Wallnoefer | 8 Jan 11:51
Picon
Favicon
Gravatar

Re: changing encoding for helma.File

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
Hannes Wallnoefer | 8 Jan 12:58
Picon
Favicon
Gravatar

helma 1.6.1 test builds

I uploaded Helma 1.6.1 test builds.

http://adele.helma.org/download/helma/1.6.1/

Please have a look and report any problems you may find.

hannes
Chris Zumbrunn | 8 Jan 14:28
Gravatar

Re: [Helma-dev] helma 1.6.1 test builds


On Jan 8, 2008, at 12:58 , Hannes Wallnoefer wrote:

> I uploaded Helma 1.6.1 test builds.
>
> http://adele.helma.org/download/helma/1.6.1/
>
> Please have a look and report any problems you may find.

The docs in these packages do not yet contain the last few changes  
from this morning.

I updated the docs at http://helma.zumbrunn.com/reference/ to be  
current. Please check these docs and ignore the ones in the packages.

Chris
Hannes Wallnoefer | 8 Jan 15:34
Picon
Favicon
Gravatar

Re: [Helma-dev] helma 1.6.1 test builds

Ok, I built and uploaded new packages. They're still at
http://adele.helma.org/download/helma/1.6.1/

Please let me know if there are any problems left.

hannes

2008/1/8, Chris Zumbrunn <chris <at> zumbrunn.com>:
>
> On Jan 8, 2008, at 12:58 , Hannes Wallnoefer wrote:
>
> > I uploaded Helma 1.6.1 test builds.
> >
> > http://adele.helma.org/download/helma/1.6.1/
> >
> > Please have a look and report any problems you may find.
>
> The docs in these packages do not yet contain the last few changes
> from this morning.
>
> I updated the docs at http://helma.zumbrunn.com/reference/ to be
> current. Please check these docs and ignore the ones in the packages.
>
> Chris
>
> _______________________________________________
> Helma-dev mailing list
> Helma-dev <at> helma.org
> http://helma.org/mailman/listinfo/helma-dev
>
(Continue reading)

tobias.schaefer | 9 Jan 21:29
Picon
Favicon

Skin files and character encoding

Hi

I just experienced a confusing issue with character encoding, too:

Trying to display the contents of a skin file encoded with UTF-8 I had to
set the -Dfile.encoding=UTF8 switch in the Java options as suggested by
Rainer Rynesch.

Otherwise I get incorrect output of UTF-8 characters, e.g. something like
€€€€€ instead of five euro symbols...

Of course I have set charset and skinCharset to UTF-8 in app.properties.

Shouldn't this be enough to achieve the correct output?

Could anybody please verify if the test setup below displays correctly
the euro symbols in his browser?

Ciao,
tobi

--

Here's the test setup:


app.properties
--------------
charset = UTF8
skinCharset = UTF8


Global/Foo.skin
---------------
Some UTF-8 characters: €€€€€


Global/Global.js
----------------
Root.prototype.main_action = function() {
   res.write(app.getSkinfilesInPath(res.skinpath).Global.Foo);
}

_______________________________________________
Helma-user mailing list
Helma-user <at> helma.org
http://helma.org/mailman/listinfo/helma-user
Picon

Re: Skin files and character encoding

Hi Tobi,

The only way I could get this to work was going to a webpage (http://www.tony-franks.co.uk/UTF-8.htm)
which had the euro char on it, but defined using a html entity code, copying that into a windows text editor
(http://www.scintilla.org/SciTE.html) set to UTF8 encoding editing the skin file. opening the file in
eclipse however shows:

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    </head>
    <body>
        €€€      
        <br/>
        ent: &#128;
        <br/>
        Some bad UTF-8 characters: €€
    </body>
</html> 

Which seems to default to be because eclipses defaulting std western char encoding.
I've also attached the skin file but not sure if it will go through the email system ok.
Hope that helps...

Maks.

> -----Original Message-----
> From: helma-user-bounces <at> helma.org 
> [mailto:helma-user-bounces <at> helma.org] On Behalf Of 
> tobias.schaefer <at> orf.at
> Sent: Thursday, 10 January 2008 07:30
> To: helma-user <at> helma.org
> Subject: [Helma-user] Skin files and character encoding
> 
> Hi
> 
> I just experienced a confusing issue with character encoding, too:
> 
> Trying to display the contents of a skin file encoded with 
> UTF-8 I had to set the -Dfile.encoding=UTF8 switch in the 
> Java options as suggested by Rainer Rynesch.
> 
> Otherwise I get incorrect output of UTF-8 characters, e.g. 
> something like €€€€€ instead of five euro symbols...
> 
> Of course I have set charset and skinCharset to UTF-8 in 
> app.properties.
> 
> Shouldn't this be enough to achieve the correct output?
> 
> Could anybody please verify if the test setup below displays 
> correctly the euro symbols in his browser?
> 
> Ciao,
> tobi
> 
> --
> 
> Here's the test setup:
> 
> 
> app.properties
> --------------
> charset = UTF8
> skinCharset = UTF8
> 
> 
> Global/Foo.skin
> ---------------
> Some UTF-8 characters: €€€€€
> 
> 
> Global/Global.js
> ----------------
> Root.prototype.main_action = function() {
>    res.write(app.getSkinfilesInPath(res.skinpath).Global.Foo);
> }
> 
> 
> 
Attachment (utf8.skin): application/octet-stream, 256 bytes
_______________________________________________
Helma-user mailing list
Helma-user <at> helma.org
http://helma.org/mailman/listinfo/helma-user
Picon

Re: Skin files and character encoding

oh and just one last thing, I just found that you can set the default encoding in eclipse using
Preferences->Workspace-Text Encoding (mine was set to default to cp1252 for some reason), but once you
set it to UTF8 you can create the file as I described directly using eclipse and the beolow file displays
correctly as:

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    </head>
    <body>
        €€€      
        <br/>
        ent: &#128;
        <br/>
        Some bad UTF-8 characters:   
    </body>
</html> 

> -----Original Message-----
> From: helma-user-bounces <at> helma.org 
> [mailto:helma-user-bounces <at> helma.org] On Behalf Of Maksim Lin 
> for technical support mailling lists
> Sent: Thursday, 10 January 2008 11:07
> To: Helma User Mailing List
> Subject: Re: [Helma-user] Skin files and character encoding
> 
> Hi Tobi,
> 
> The only way I could get this to work was going to a webpage 
> (http://www.tony-franks.co.uk/UTF-8.htm) which had the euro 
> char on it, but defined using a html entity code, copying 
> that into a windows text editor 
> (http://www.scintilla.org/SciTE.html) set to UTF8 encoding 
> editing the skin file. opening the file in eclipse however shows:
> 
> <html>
>     <head>
>         <meta http-equiv="Content-Type" 
> content="text/html;charset=UTF-8">
>     </head>
>     <body>
>         €€€     
>         <br/>
>         ent: &#128;
>         <br/>
>         Some bad UTF-8 characters: €€
>     </body>
> </html>
> 
> Which seems to default to be because eclipses defaulting std 
> western char encoding.
> I've also attached the skin file but not sure if it will go 
> through the email system ok.
> Hope that helps...
> 
> Maks.
> 
> > -----Original Message-----
> > From: helma-user-bounces <at> helma.org
> > [mailto:helma-user-bounces <at> helma.org] On Behalf Of 
> > tobias.schaefer <at> orf.at
> > Sent: Thursday, 10 January 2008 07:30
> > To: helma-user <at> helma.org
> > Subject: [Helma-user] Skin files and character encoding
> >
> > Hi
> >
> > I just experienced a confusing issue with character encoding, too:
> >
> > Trying to display the contents of a skin file encoded with
> > UTF-8 I had to set the -Dfile.encoding=UTF8 switch in the 
> Java options 
> > as suggested by Rainer Rynesch.
> >
> > Otherwise I get incorrect output of UTF-8 characters, e.g.
> > something like €€€€€ instead of five euro symbols...
> >
> > Of course I have set charset and skinCharset to UTF-8 in 
> > app.properties.
> >
> > Shouldn't this be enough to achieve the correct output?
> >
> > Could anybody please verify if the test setup below 
> displays correctly 
> > the euro symbols in his browser?
> >
> > Ciao,
> > tobi
> >
> > --
> >
> > Here's the test setup:
> >
> >
> > app.properties
> > --------------
> > charset = UTF8
> > skinCharset = UTF8
> >
> >
> > Global/Foo.skin
> > ---------------
> > Some UTF-8 characters: €€€€€
> >
> >
> > Global/Global.js
> > ----------------
> > Root.prototype.main_action = function() {
> >    res.write(app.getSkinfilesInPath(res.skinpath).Global.Foo);
> > }
> >
> >
> >
> 
> 
> 
_______________________________________________
Helma-user mailing list
Helma-user <at> helma.org
http://helma.org/mailman/listinfo/helma-user

Gmane