Error: Chữ hoa có dấu (Uppercased Vietnamese with accen

Unicode-compliant Viet fonts

Moderators: johnkha3, phuochung

Error: Chữ hoa có dấu (Uppercased Vietnamese with accen

Postby nghiahd » Thu Jul 24, 2003 9:22 am

I have:

WindowsXP service pack 1
Oracle Database version 9.2.0.3.0
OC4J 904 and the attached JDBC drivers
NLS_CHARACTERSET = VN8VN3
NLS_NCHAR_CHARACTERSET = AL16UTF16
JDK 1.4.1_02
MSIE 6

(the server on which I run OC4J is Windows 2000 Service Pack 3).

I have a NVARCHAR2 column which I can save and retrieve most Unicode characters (Vietnamese ) correctly - except for some of those uppercase Vietnamese characters:
"Ở ĐÂY CÓ CHỮ HOA CÓ DẤU"
And this is the corresponding escape sequences I retreived as follow: I entered the texts into a file with some Vietnamese keyboard tool, then saved the file in UTF-8, then use the native2ascii tool shipped with JDK to convert).
"\u1ede \u0110\u00c2Y C\u00d3 CH\u1eee HOA C\u00d3 D\u1ea4U"
the escape sequence is assigned to a java.lang.String, then I use the PreparedStatement to insert the String into the table.
Getting back the record and display in a utf-8 encoded page, I can only receive this ugly string:
"? ĐÂY C? CH? HOA C? D?U!"

the same lower case string:
"ở đây có chữ hoa có dấu"
"\u1edf \u0111\u00e2y c\u00f3 ch\u1eef hoa c\u00f3 d\u1ea5u"
saved, retrieved and displayed correctly.

(please try out yourself if you can - thanks).

Any body can help me to find out mistakes (with me, NVARCHAR2 or Oracle thin driver?)
Huynh Duc Nghia
nghiahd
 
Posts: 2
Joined: Thu Jul 24, 2003 9:13 am

Postby nghiahd » Fri Jul 25, 2003 1:43 am

Xin lỗi mọi người đã mất công đọc - tôi đã tìm ra lỗi rồi. Lỗi nằm ở phần lưu xâu Unicode vào Oracle.
Tôi quên gọi hàm
oracle.jdbc.OraclePreparedStatement.setFormOfUse(1,oracle.jdbc.OraclePreparedStatement.FORM_NCHAR);
Hàm này thông báo cho Oracle biết cột được cập nhật là NCHAR (Unicode) - not CHAR.
Tôi đã gọi hàm này và OK.
Chân thành cảm ơn.
Huynh Duc Nghia
nghiahd
 
Posts: 2
Joined: Thu Jul 24, 2003 9:13 am


Return to Font

Who is online

Users browsing this forum: No registered users and 1 guest