Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4324864
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:11:24+00:00 2026-05-21T09:11:24+00:00

I am using jdk1.3 for blackberry platform. Now I am facing a problem when

  • 0

I am using jdk1.3 for blackberry platform. Now I am facing a problem when I trying to read an Unicode encoded xml file.

My code :

java.io.BufferedReader br = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(path),"UTF16"));
br.readLine();

Error:

sun.io.MalformedInputException: Missing byte-order mark
    at sun.io.ByteToCharUnicode.convert(ByteToCharUnicode.java:123)
    at java.io.InputStreamReader.convertInto(InputStreamReader.java:137)
    at java.io.InputStreamReader.fill(InputStreamReader.java:186)
    at java.io.InputStreamReader.read(InputStreamReader.java:249)
    at java.io.BufferedReader.fill(BufferedReader.java:139)
    at java.io.BufferedReader.readLine(BufferedReader.java:299)
    at java.io.BufferedReader.readLine(BufferedReader.java:362)

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:11:25+00:00Added an answer on May 21, 2026 at 9:11 am

    You XML file is missing a byte order mark.

    In JDK 1.3, the byte order mark is mandatory if you use UTF-16. Try the UTF16-LE or -BE if you know in advance what the endianness is.

    (The BOM is not mandatory in 1.4.2 and above.)

    Of course, if your file is not UTF-16 at all, use the correct encoding. See the above link to character encodings. The actual encodings supported, apart from a small set of core encodings, are implementation defined so you’ll need to check the docs for your particular JDK.

    The encoding the files are in is supposed to be in the <xml> header of your files, something like:

    <?xml version="1.0" encoding="THIS IS THE ENCODING YOU NEED TO USE"?>
    

    If the file is in a single character encoding, or UTF-8 (without a BOM), You can try reading the first line with plain US-ASCII, it shouldn’t contain any data outside that range. Parse the encoding field, then re-open the file with the deduced encoding.

    This will only work if the actual encoding is supported by your platform obviously.

    BTW: JDK 1.3 is ancient. Are you sure that’s your version? (Doesn’t change anything to the problem anyway except for the BOM part)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: compiling project with jdk1.5 using maven2 I am trying to build java
While trying to call an EJB made using NETbeans (using jdk1.7) from a client
I have installed jdk1.6.0_21 and sqldeveloper(using alien) on debian(lenny). Now when I run sqldeveloper
I am using Eclipse 3.6, while opening web.xml file in my Web application. it's
I'm trying to compile a java program that is using JavaDB/Derby. On the command
I am using oracle 11g. I write code to connect oracle database with java
I'm using ColdFusion MX7 to perform a CFEXECUTE on some Java 6 code. Unfortunately,
I'm using Java 6 for learning more about web Services (JAX-WS). I also read
i am currently using xslt1.0 and jdk1.6.0_10 for converting xml to html..but i couldnt
I am trying to compile a software using javac. The problem is i removed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.