[encoding]Stupid question regarding encoding



I have written a java plugin for an application that reads a file to execute
a series of actions ; when I parse my text file I check for the existence
of the following line "#HEADER" ; it works fine on my equipment ; on
Windows somebody working with the text file encoded in utf-8 told me that
there is problem as the line containing "#HEADER" is not found !

Now I am a little bit puzzled about all this :

(a) when you write java code and compile it what happens to the
string "#HEADER" because it will be used in the following test :
if (line.equals("#HEADER") {...}
where line is read from the text file with encoding as is on the machine
where the class is executed ? in other words you are comparing what to
what ?

(b) when with a Java app you read a text file can you get its encoding
format like utf-8 or ANSI or whatever to decide about some actions to be
taken ?

I think the problem could be easily solved by replacing "#HEADER"
by "_HEADER" but I have to go to the bottom of this to understand what is
going on.
Thanks
.



Relevant Pages

  • Re: java executables using batch
    ... First thing I'd do is use Java launcher rather than BPXBATCH to execute your java programs. ... IGD103I SMS ALLOCATED TO DDNAME ... IGD104I HFS FILE WAS RETAINED, ...
    (bit.listserv.ibm-main)
  • Re: CFS: some bad numbers with Java/database threading
    ... Hmm, I know diddly about Java, and I don't want to preempt Antoine's next ... threads are started in a tight loop. ... where he said the *same* thread needs to execute ... multiple queries on the same data, and therefore your test code is susceptible ...
    (Linux-Kernel)
  • Re: Object serialization and NetworkStream - extraneous characters in output
    ... > and at the other side, when you retrieve the stream and try reading the ... > As for the problem you mentioned, I think it is likely due to the encoding ... > ASCII stream won't have such a header). ... If you found the problems occur in your java client that recieve this ...
    (microsoft.public.dotnet.framework)
  • Re: Object serialization and NetworkStream - extraneous characters in output
    ... > and at the other side, when you retrieve the stream and try reading the ... > As for the problem you mentioned, I think it is likely due to the encoding ... > ASCII stream won't have such a header). ... If you found the problems occur in your java client that recieve this ...
    (microsoft.public.dotnet.framework)
  • RE: Object serialization and NetworkStream - extraneous characters in output
    ... > and at the other side, when you retrieve the stream and try reading the ... > As for the problem you mentioned, I think it is likely due to the encoding ... > ASCII stream won't have such a header). ... If you found the problems occur in your java client that recieve this ...
    (microsoft.public.dotnet.framework)