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 5844181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:15:23+00:00 2026-05-22T12:15:23+00:00

Hello I am trying to read a UTF-8 encoded txt files with Hebrew chars

  • 0

Hello I am trying to read a UTF-8 encoded txt files with Hebrew chars on my android application, and now after managing doing for some reason the ‘a’ char is always appended at the beginning of the String i read.. and I wonder why

Here is my code:

        void Read(){
        try {
            File fileDir = new File("/sdcard/test.txt");

            BufferedReader in = new BufferedReader( new InputStreamReader(
                          new FileInputStream(fileDir), "UTF8"));

            String str;

            while ((str = in.readLine()) != null) {
                    Log.i("TEST",str);
            }

                    in.close();
            } 
            catch (UnsupportedEncodingException e) 
            {
                System.out.println(e.getMessage());
            } 
            catch (IOException e) 
            {
                System.out.println(e.getMessage());
            }
            catch (Exception e)
            {
                System.out.println(e.getMessage());
            }
        }

this is the result i get

05-15 01:53:25.269: INFO/TEST(16236): אבגדהוזחטיכלמנסעפצקרשתa

  • 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-22T12:15:23+00:00Added an answer on May 22, 2026 at 12:15 pm

    In order to get a better answer, I need two questions answered:

    • What is the exact code point of the character in question (your “a”)?
    • What is the exact byte sequence in your file, around the questionable area?

    I’m going to take a guess here: You say the character is the first thing in the file (“appended at the beginning of the String”) and that you got back it’s in the Arabic Presentation Forms B block. The last character of Arabic Presentation Forms B, which oddly has nothing to do with Arabic, is U+FFEF, or the byte order mark (BOM). It usually appears at the beginning of UTF-16 or UTF-32 encoded files, and identifies the “endianess” of the encoding (whether the file is UTF-16LE or UTF-16BE encoded, likewise for UTF-32). It typically does not appear, however, in UTF-8 data, as UTF-8 has no notion of “byte order”. That said, some brain-dead Windows programs will stick it there, and then have an additional option of “UTF-8 without BOM”. (The BOM is used then to identify a file as likely being encoded in UTF-8.) My guess is you have a BOM in your data, and your program is reading it and passing it on to you.

    IF this is your problem, and your file is genuinely encoded in UTF-8, you should be able to find the following byte sequence near the beginning of the file: EF BB BF — this is the UTF-8 representation of U+FFEF.

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

Sidebar

Related Questions

I am trying to read a list of values from a text file, hello.txt
I'm trying to read/write files to the sdcard. I've tried doing this both on
Hello I am trying to read a textbox(runatserver) after is gets populated form the
I can't create an utf-8 csv file in Python. I'm trying to read it's
hello fellow java developers. I'm having a very strange issue. I'm trying to read
I'm trying to create a program for Android which will read in text, and
Hello I am trying to read my xml document using xpath. I have been
Hello there im trying to send files using client-server classes in java. For some
I'm trying to use Android Maps, following the instructions in Hello MapView . I've
Hello I'm trying to read some data from the serial port and record it

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.