Home » Developer & Programmer » Forms » Character set conversion (oracle forms(10g))
Character set conversion [message #636137] Fri, 17 April 2015 09:29 Go to next message
xpact83
Messages: 225
Registered: October 2008
Location: philippines
Senior Member
Our app server's NLS_LANG in regedit is AMERICAN_AMERICA.WE8ISO8859P1 our database character set is AMERICAN_AMERICA.WE8MSWIN1252. The problem is, the forms and report can't display chr(151) because the character set in app server is AMERICAN_AMERICA.WE8ISO8859P1 .


DECLARE
 fr_charset CONSTANT VARCHAR2(30) := 'WE8ISO8859P1';

 to_charset VARCHAR2(30) := 'WE8MSWIN1252';
 rawvar     RAW(100);
 v_rec      VARCHAR2(100);
BEGIN
  
  select x --value of x is chr(151)
    into v_rec
    from x;

  rawvar := utl_raw.convert(UTL_RAW.CAST_TO_RAW(v_rec),
  'AMERICAN_AMERICA.'||to_charset,
  'AMERICAN_AMERICA.'||fr_charset);

  dbms_output.put_line(utl_raw.cast_to_varchar2(rawvar));
  message('AMERICAN_AMERICA.'||fr_charset);
  message('AMERICAN_AMERICA.'||fr_charset);
  :text_item5:=utl_raw.cast_to_varchar2(rawvar);
END;
Re: Character set conversion [message #636139 is a reply to message #636137] Fri, 17 April 2015 10:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

If application server, client and database instance owner are properly configured (proper NLS_LANG), you have nothing to do, SQL*Net transparently makes the conversion for you.

[Updated on: Fri, 17 April 2015 10:13]

Report message to a moderator

Re: Character set conversion [message #636170 is a reply to message #636139] Sat, 18 April 2015 21:15 Go to previous messageGo to next message
xpact83
Messages: 225
Registered: October 2008
Location: philippines
Senior Member
Is there no other way? Changing the character set in app server will affect our other modules.the current char set cant read chr(151).
Re: Character set conversion [message #636177 is a reply to message #636170] Sun, 19 April 2015 00:49 Go to previous message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Garbage in garbage out.

Previous Topic: activate push button only one time in the day
Next Topic: Getting client info viz. IP-Address, Host Name in Oracle 10g via middle tier
Goto Forum:
  


Current Time: Thu Apr 18 05:47:00 CDT 2024