Re: oracle with us7ascii encode character lost

2009-05-25 Thread Ian Kelly

On May 25, 1:07 pm, Andrási László (g)  wrote:
> Hi,
>
> We have a problem with an Oracle DB version 10g Release 10.2.0.1.0., Django
> latest svn version and cx_Oracle 5.0.1-2
>
> "select * from nls_database_parameters where parameter='NLS_CHARACTERSET';"
> returns  US7ASCII
>
> We tried to change the NLS_LANG enviroment setting to US7ASCII so we got a
> good result on the page with accentuated letters.
> After that we try to change the data on the form and submit.
> When we tried to insert a new object into the database all the accentuated
> letters where lost.
> We got question marks at those positions.
> We must use US7ASCII, because the database used by the SAP already.
>
> How could we convert the data without loosing letters?

First, don't touch NLS_LANG at all.  NLS_LANG identifies the client
encoding, not the database encoding.  Django uses UTF-8 internally, so
NLS_LANG should be set to that.

Second, Django uses NVARCHAR2 columns by default, so the
NLS_CHARACTERSET setting shouldn't matter; data will be stored using
the NLS_NCHARACTERSET setting, which is necessarily Unicode.  Check
your tables to make sure they're using NVARCHAR2/NCLOB rather than
VARCHAR2/CLOB columns.

Finally, you could be having a problem with bind parameters being
transmitted in the database character set by the Oracle driver,
although I think those problems have been cleared up.  If the above
two steps don't solve the problem, try recompiling cx_Oracle with the
WITH_UNICODE option.

Hope that helps,
Ian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: oracle with us7ascii encode character lost

2009-05-25 Thread Petite Abeille


On May 25, 2009, at 9:07 PM, Andrási László (g) wrote:

> US7ASCII
> How could we convert the data without loosing letters?

Hmmm... you can't. Your database is set to store US-ASCII characters  
only.

Read on about Oracle "globalization":

http://www.oracle.com/technology/pub/columns/trute_unicode.html
http://www.oracle.com/technology/tech/globalization/index.html
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14225/toc.htm

--
PA.
http://alt.textdrive.com/nanoki/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



oracle with us7ascii encode character lost

2009-05-25 Thread g
Hi,

We have a problem with an Oracle DB version 10g Release 10.2.0.1.0., Django
latest svn version and cx_Oracle 5.0.1-2

"select * from nls_database_parameters where parameter='NLS_CHARACTERSET';"
returns  US7ASCII


We tried to change the NLS_LANG enviroment setting to US7ASCII so we got a
good result on the page with accentuated letters.
After that we try to change the data on the form and submit.
When we tried to insert a new object into the database all the accentuated
letters where lost.
We got question marks at those positions.
We must use US7ASCII, because the database used by the SAP already.

How could we convert the data without loosing letters?

Thx,
-- 
Andrási László

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---