• Post Reply Bookmark Topic Watch Topic
  • New Topic

Windows/Unix Encoding Problems  RSS feed

 
Joshua White
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java app that reads in excel files and inserts them into a database. This excel file may contain special characters such as a tilde.

To make a long story short, this process works on windows and does not on solaris.

Using the following code:


I get the following results (I have labeled the UNIX/Windows versions):

Windows Encoding: Cp1252
Windows file.encoding: windows-1252


UNIX Encoding: ASCII
UNIX file.encoding: file.encoding: 646

Obviously they are different. The question is, where can I change the UNIX values? Are there both environmental and java settings?

Regards,

Joshua
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'd be better off specifying an encoding to use on both platforms (UTF-8 maybe). That way, when you put stuff into the db, you're encoding it using a known encoding. Then, when you read it back out, you're using the exact same encoding.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UTF-16 could also be used to support more characters encoding/decoding...

Well, I mean any standard scheme could be used, but we just need to make remember which is used so that we can use them again during decoding...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!