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

  • Home
  • SEARCH
  • 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 5846851
In Process

The Archive Base Latest Questions

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

I’ve run into a very strange problem in Eclipse, and I’m not sure if

  • 0

I’ve run into a very strange problem in Eclipse, and I’m not sure if its a bug or if some settings are just wrong.

I’m using Fedora Eclipse on Fedora 14.

I first noticed this issue when opening a file with null characters in the eclipse text editor. After the first null character was reached, no further characters were displayed. Furthermore, if the file contained a new line after the null everything between the null and newline was not displayed, but resumed properly after the newline.

Example:

#A file with values: 
66 6F 6F 00 62 61 72

#Displays:
foo

#When it should read something like:
fooNULLbar

This wouldn’t be more than a minor annoyance if it didn’t extend to I/O when running a program in Eclipse. If I try to read the file in the previous example with an InputStream or Reader, it results in an end of file just before the null.

Example:

# File: test
66 6F 6F 00 62 61 72

# File: Test.java
import java.io.File;
import java.io.FileInputStream;

public class Test {
    public static void main( String[] args ) {
        try {
            File file = new File( "test" );

            FileInputStream in = new FileInputStream( file );

            int b;
            while ( ( b = in.read() ) != -1 ) {
            System.out.print( (char) b );
            }

            in.close();
        } catch ( Exception e ) {
            System.err.println( e.getMessage() );
        }
    }
}

# Produces output to Eclipse console:
foo

# While when run from command line, it produces:
fooNULLbar

When I open these files or run these programs outside of Eclipse, everything works correctly including programs compiled in Eclipse.

I came across this while Googling the issue, but I’m not sure if it’s the same issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=283231

Thanks in advance for all help.

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

    I think you are interpreting the output incorrectly, i.e. how the string is rendered on screen. Because any normal string will look strange if you use some strange font. A regular unicode string will look something different in one locale but not the other. Even a properly rendered unicode string containing, for e.g. Devnagari characters, will look strange to someone who has never seen those before. Hence the null character probably will look strange. This may be because it is not a character that you want to display in the first place. Also, null character is not the string terminator (as you might be thinking due to C/C++). Java does handle it properly.

    As a simple test, just try to print ‘\0’ in the Java program and see what output you get, ‘null‘ or something strange. 🙂

    From the Java Doc:

    print

    public void print(String s)
    

    Print a string. If the argument is null then the string “null” is printed. Otherwise, the string’s characters are converted into bytes according to the platform’s default character encoding, and these bytes are written in exactly the manner of the write(int) method.
    Parameters:

    s - The String to be printed
    

    Hope this helps.

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

Sidebar

Related Questions

I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
this is what i have right now Drawing an RSS feed into the php,
I have some data like this: 1 2 3 4 5 9 2 6
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.