× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



    Hi James,

    Properties files are always expected to be in ISO 8859-1 encoding.  From
the Properties javadoc:

"When saving properties to a stream or loading them from a stream, the ISO
8859-1 character encoding is used. For characters that cannot be directly
represented in this encoding, Unicode escapes are used; however, only a
single 'u' character is allowed in an escape sequence. The native2ascii tool
can be used to convert property files to and from other character
encodings."

    As noted, you can use native2ascii, which works but is a bit of a pain.
I've looked around but haven't seen anyhting that does what I think is a
proper job for properties.  As a result, one of my back burner projects is a
commercial quality properties editor fit for developers that can also be
shipped to end users with configurable restrictions.  Among other things, it
handles the business of entering and viewing data in normal Java Unicode,
but saving and reading it as ISO 8859-1.  It also solves the problem of
losing comments if a Java program rewrites a properties file using
Properties.store().

    I've attached some small images of its current state.  If you or anyone
on the list has suggestions for features or changes, let me know.  In the
meantime, good luck.


                                                         Joe Sam

Joe Sam Shirah -        http://www.conceptgo.com
conceptGO       -        Consulting/Development/Outsourcing
Java Filter Forum:       http://www.ibm.com/developerworks/java/
Just the JDBC FAQs: http://www.jguru.com/faq/JDBC
Going International?    http://www.jguru.com/faq/I18N
Que Java400?            http://www.jguru.com/faq/Java400


----- Original Message ----- 
From: "James H H Lampert" <jamesl@xxxxxxxxxxx>
To: <java400-l@xxxxxxxxxxxx>
Sent: Tuesday, March 15, 2005 9:01 PM
Subject: Anybody got experience with non-Latin-1 properties files?


> We've just hit a stumbling block in a project involving
> Turkish translation. It seems that we've got our
> EBCDIC-to-Unicode translation routines working perfectly
> with Turkish EBCDIC, but now, on the client side, we've
> run into a problem with properties files. It seems that no
> matter what we do, whether we save them as UTF-8 or as
> Unicode, our properties files get treated as 8-bit Latin
> 1, both by our client-side program, and by JBuilder. (We
> can, however, read and write them fine from Windoze
> Notepad; go figure.)
>
> We've found that using backslash unicode escapes does work, but that
> renders the properties files a bit hard to read and update.
>
> Can anybody suggest a more elegant solution? Or even just a
> fully-unicode-escape-aware properties file editor?
>
> --
> James H. H. Lampert
> Professional Dilettante
>

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.