[jsword-devel] i18n features in Java 6

Martin Denham mjdenham at gmail.com
Thu Dec 30 14:41:08 MST 2010


There also seems to be a Properties.loadFromXML() method in Java 5 which
uses UTF-8 encoded xml files which may be of interest.

On 30 December 2010 16:33, DM Smith <dmsmith at crosswire.org> wrote:

> On 12/29/2010 04:14 PM, Martin Denham wrote:
>
>> Hi,
>>
>> I have been grappling with escaped foreign characters in properties files
>> recently.  Android resource files allow normal foreign characters to be used
>> but standard java properties require awkward escape codes e.g. /u0107
>> resulting in unreadable files containing strings like:
>>   Pentateuch = Pi\u0119cioksi\u0105g
>> In case somebody else makes the same mistake there is a utility called
>> native2ascii that converts foreign characters to escape codes.
>>
>
> It is a painful process. In Eclipse I use a plugin to make it easier. I've
> used JInto with reasonable success. (Right now my Eclipse installation is
> broken or I'd check to see what I'm currently using.)
>
>
>
>> However, there is a new feature in Java 6 that allows foreign characters
>> to be entered directly into properties files. See this article for info:
>> http://jdevelopment.nl/java/internationalization-jsf-utf8-encoded-properties-files/
>>
>
> I saw this (native UTF-8, rather than encoded ASCII) as I was poking around
> the other day in the Properties.java source code. From a quick glance it
> appeared that to use it one had to use new methods. That a file was either
> encoded or unencoded and the user had to know which one. I did not look to
> see how ResourceBundle knew whether to do one or the other.
>
> The problem we have with Java versions is Mac support. Tiger (aka 10.4) was
> released April 2005 and does not have Java 6. Leopard (aka 10.5), released
> October 2007, has Java 6. For PowerPC and slower Intel chips, Tiger is
> faster than Leopard (aka 10.5, released October 2007). I think it is
> reasonable for JSword to support Java 5. When Lion comes out, we might move
> to Java 6.
>
> So the question is whether we can snag the new Properties and use it in
> place of the current and have ResourceBundle use it?
>
>
>
>> I realise you are trying to simplify the translation of resource files so
>> thought I would throw this in.
>>
>
> I'm looking forward to it!
>
>
>> Best regards
>> Martin
>>
>
>
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20101230/069ea011/attachment.html>


More information about the jsword-devel mailing list