C
Christoph Breidert
Hello Folks,
I'm new to Linux and Redhat, so please excuse me, if this is a simple
problem. I have also posted in the corresponding redhat newsgroup.
I did search the newsgroups, and could not find any relevant postings.
My Problem is that with java 1.4.2_03 under redhat 9.0 I do not get
the 'umlaut' (öäüöäü) displayed correctly when using java.
I have a file containing some ööääüü-characters. VI shows them all
right. Reading from this file with java, displaying the content on the
system.out and then writing to another file destroys all umlauts.
Below is the sample code:
BufferedReader in = new BufferedReader(new FileReader("umlaut.txt"));
//file containing ööääüü
StringBuffer sb = new StringBuffer();
while(true){
String s = in.readLine();
if(s == null)
break;
sb.append(s);
System.out.println(s);
}
File f = new File("testfile");
BufferedWriter out = new BufferedWriter(new FileWriter(f));
out.write(sb.toString(), 0, sb.length());
out.flush();
out.close();
<<
Is this a redhat bug? Is this a java bug? Am I missing something?
The sample code gives correct results when executed on a windows
machine, and on other linux systems with different java/redhat
versions.
THX for help,
Christoph
I'm new to Linux and Redhat, so please excuse me, if this is a simple
problem. I have also posted in the corresponding redhat newsgroup.
I did search the newsgroups, and could not find any relevant postings.
My Problem is that with java 1.4.2_03 under redhat 9.0 I do not get
the 'umlaut' (öäüöäü) displayed correctly when using java.
I have a file containing some ööääüü-characters. VI shows them all
right. Reading from this file with java, displaying the content on the
system.out and then writing to another file destroys all umlauts.
Below is the sample code:
BufferedReader in = new BufferedReader(new FileReader("umlaut.txt"));
//file containing ööääüü
StringBuffer sb = new StringBuffer();
while(true){
String s = in.readLine();
if(s == null)
break;
sb.append(s);
System.out.println(s);
}
File f = new File("testfile");
BufferedWriter out = new BufferedWriter(new FileWriter(f));
out.write(sb.toString(), 0, sb.length());
out.flush();
out.close();
<<
Is this a redhat bug? Is this a java bug? Am I missing something?
The sample code gives correct results when executed on a windows
machine, and on other linux systems with different java/redhat
versions.
THX for help,
Christoph