Setting Charset problem
We have created 2 routines to encode (encrypt) and decode (decrypt) text files. In order to work properly they need to use the same character set, so you can decode an encrypted file and get the same result. This is a running on a linux box.
In the environment we set LANG=en_US.iso885915 for all users.
for any normal user everything it encrypts and decrypts uses the right character set.
The problem is the root account. It always want to encrypt using ASCII (even though LANG is set correctly) and presumably wants to decrypt using that charset as well.
Even with the decoder forcing the proper character set:
inStream = new InputStreamReader(fileIn,"ISO8859_15");
The decoding always fails for root, or if you su from root to any account that normally works
Anyone got any ideas?
Found the problem
We've figured it out. Turns out that on Linux you can set an environment variable called LC_ALL
If you set it to something like LC_ALL=C
Then all your ls output will come out the way we all like with Uppercase first then lowercase. However it totally buggers up Java when you do this. My advice is not to use it.
Instead use LC_COLLATE=C
That will give you the listings you want, in the order you like and not mess with how you want java to work.
Thanks for passing on the update and your solution.