Home » SQL & PL/SQL » SQL & PL/SQL » CHARSET CONVERSION (Oracle 11G )
CHARSET CONVERSION [message #597230] Tue, 01 October 2013 14:56 Go to next message
sreedi
Messages: 1
Registered: October 2013
Junior Member
Hi,

I'm trying to retrieve data stored in VARCHAR2 column of a table in CHARSET LATIN1 (ISO-8859-1) which is same as the Database Server charset. My Client windows machine NLS_LANG is set to 'WE8MSWIN1252'

I tried using utl_raw.convert(utl_raw.cast_to_raw(comment_text),'AMERICAN_AMERICA.AL32UTF8','AMERICAN_AMERICA.WE8ISO8859P1');

Note:- data in this VARCHAR2 column is stored from Java client that uses UTF-8 charset after converting to ISO-8859-1.

This doesn't seem to be work as some special chars liek ' and " are not converted and weird charachters are displayed.

However, I'm able to convert this data back to UTF-8 charset from ISO-8859-1 charset using Java String objects without any issues.

I have a constraint that I cannot use Java for this reverse conversion and it has to be in PL/SQL. Appreciate any suggestions.

Thanks
icon13.gif  Re: CHARSET CONVERSION [message #597245 is a reply to message #597230] Wed, 02 October 2013 00:17 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

If your client is correctly set there is nothing to do, Oracle converts automatically.
If your client application uses UTF8 then the NLS_LANG must be set with UTF8 not WE8MSWIN1252.

Previous Topic: Clob_Agg Order by
Next Topic: after/every 5 rows print the string "execute;" in output [SQL generates batch]
Goto Forum:
  


Current Time: Fri Mar 29 08:45:55 CDT 2024