开发者

Handling Special char such as ^ÛY, ^ÛR in java

开发者 https://www.devze.com 2022-12-29 18:02 出处:网络
Has anybody encountered special char such as ^ÛY, ^ÛR ? Q1. How do I do an ftp of the files containing these chars? The chars are not seen once I do a ftp on AIX (bi or ascii) and hence I am unabl

Has anybody encountered special char such as ^ÛY, ^ÛR ?

Q1. How do I do an ftp of the files containing these chars? The chars are not seen once I do a ftp on AIX (bi or ascii) and hence I am unable to see my program to replace these, working.

Q2. My java program doesn't seem to recognise these or replace these if I search for these explicitly (^ÛY, ^ÛR ) in the file however a replace using regular expression seems to work (I could only see the difference in the length of the string). My program is executed on AIX. Any insights why java cannot recognise these?

Q3. Does the Oracle database recognise thes开发者_如何学JAVAe chars? An update is failing where my program indicates the string to be of lesser length and without these characters but the db complains "value too large for column" as the string to be updated contains these chars and hence longer.

thanks in advance,

RJ


I assume the characters you talk about are non-Latin alphabet letters encoded in file contents used specific encodings.

There are separate solutions for each section of the setup: AIX, Java and Oracle.

Basically, for AIX and Oracle separately you would need to adapt locale settings to match the content you are trying to work with.

I am not sure of the exact procedure on AIX, but you would need to set locale settings on server, and then update your telnet/ssh program settings that you use to connect with, to allow you to write/see appropriate chars.

This should incidentally fix Java as well, as it would recognize the locale settings, but if you need manual tweaking google for Java + LOCALE, perhaps here: http://java.sun.com/developer/technicalArticles/J2SE/locale/

It seems should work for Oracle too, but once again you might need to do some extra such as tweaking NLS_LANG variable: http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.ii.doc/opt/tlsorc13.htm

0

精彩评论

暂无评论...
验证码 换一张
取 消