Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IllegalArgumentException: Malformed \uxxxx encoding

126 views
Skip to first unread message

Uday Pai

unread,
Aug 5, 1999, 3:00:00 AM8/5/99
to
I am using JDK 1.2 on WinNT SP5
I am trying to load properties from a file as follows:

..
<snip>
..
Properties draftResources = null;
FileInputStream fileStream = new FileInputStream(filePath);
>>draftResources.load(fileStream);

After executing the above line, my Application crashes with
the following error:

java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert(Properties.java:290)
at java.util.Properties.load(Properties.java:239)
at JDraftPropertySet.initDraftResources(JDraftPropertySet.java:683)
at JDraftPropertySet.initProperties(JDraftPropertySet.java:147)
at JDraft.loadJDraftProperties(JDraft.java:1136)
at JDraft.startApplication(JDraft.java:826)
at JDraft.main(JDraft.java:675)

Any idea what the foll means???
java.lang.IllegalArgumentException: Malformed \uxxxx encoding


The file I am trying to load is a Simple ASCII File.

Thanks

Uday

Fredrik Lännergren

unread,
Aug 6, 1999, 3:00:00 AM8/6/99
to
*snip*

> Any idea what the foll means???
*snip*

> java.lang.IllegalArgumentException: Malformed \uxxxx encoding
> The file I am trying to load is a Simple ASCII File.
*snip*

\uxxxx is a unicode character, and \u00xx is the place where the 8 bit ASCII
characters reside. It looks to me like there somewhere in the file is a "\u"
somewhere that isn't followed by the expected four digits, which constitutes
a malformed unicode character. Have a look in the file and see; if there
somewhere in there is, for instance "\uday", make it look like "\\uday"
instead, or it will try to read it as a unicode character.

See the JavaDocs on Properties.load():
"
Within the element string, the ASCII escape sequences \t, \n, \r, \\, \",
\', \ (a backslash and a space), and \\uxxxx are recognized and converted to
single characters.
"

That's the first possibility that pop up in my mind.

Hope that helps.
Fredrik Lännergren

0 new messages