Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » Special characters and symbols in django? [RSS Feed]

#1 June 17, 2010 15:50:05

c.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Special characters and symbols in django?


Hi all

i have an application in django that is used by our academics to apply
for approval for projects

So it will be used by many different people many of whom will be cut
and pasting scientific information from MS Word into text fields in
django forms

Underneath it all is an oracle database (that i can't modify
significantly) this has NLS_NCHAR_CHARACTERSET=AL16UTF16 and
NLS_CHARACTERSET=WE8ISO8859P1.

One of the first 'real life' projects we tested it with had an alpha,
a ™ and a couple of curly apostrophes.

These were rendered as ¿in django and caused an "ORA-24365: error in
character conversion" error when trying to do a select on the oracle
table in sql plus

Any help or pointers (or just somewhere to start googling) would be
gratefully received

Cheers
Charlie

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

Offline

#2 June 18, 2010 07:15:17

I.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Special characters and symbols in django?


On Jun 17, 8:50 am, "c.poll...@bangor.ac.uk" <c.poll...@bangor.ac.uk>
wrote:
> Hi all
>
> i have an application in django that is used by our academics to apply
> for approval for projects
>
> So it will be used by many different people many of whom will be cut
> and pasting scientific information from MS Word into text fields in
> django forms
>
> Underneath it all is an oracle database (that i can't modify
> significantly) this has NLS_NCHAR_CHARACTERSET=AL16UTF16 and
> NLS_CHARACTERSET=WE8ISO8859P1.
>
> One of the first 'real life' projects we tested it with had an alpha,
> a ™ and a couple of curly apostrophes.
>
> These were rendered as ¿in django and caused an "ORA-24365: error in
> character conversion" error when trying to do a select on the oracle
> table in sql plus
>
> Any help or pointers (or just somewhere to start googling) would be
> gratefully received

What version of Django are you using, and what is the type of the
column in the database? It sounds like you're most likely using a
CLOB or a VARCHAR2, which won't be able to handle those characters
since they aren't included in ISO-8859-1. If the column is NCLOB or
NVARCHAR2, then Django should handle the encoding conversions for you.

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-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 June 18, 2010 10:42:31

c.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Special characters and symbols in django?


Django version 1.1.2 and yes the columns in questions are nclob and
nvarchar

The form i was using was to add the data was generated using model
formset factory

Are there characters django just can't cope with? Do i need to clean
them out before saving the data?

Cheers for any help


On Jun 18, 7:15 am, Ian <ian.g.ke...@gmail.com> wrote:
> On Jun 17, 8:50 am, "c.poll...@bangor.ac.uk" <c.poll...@bangor.ac.uk>
> wrote:
>
>
>
> > Hi all
>
> > i have an application in django that is used by our academics to apply
> > for approval for projects
>
> > So it will be used by many different people many of whom will be cut
> > and pasting scientific information from MS Word into text fields in
> > django forms
>
> > Underneath it all is an oracle database (that i can't modify
> > significantly) this has NLS_NCHAR_CHARACTERSET=AL16UTF16 and
> > NLS_CHARACTERSET=WE8ISO8859P1.
>
> > One of the first 'real life' projects we tested it with had an alpha,
> > a ™ and a couple of curly apostrophes.
>
> > These were rendered as ¿in django and caused an "ORA-24365: error in
> > character conversion" error when trying to do a select on the oracle
> > table in sql plus
>
> > Any help or pointers (or just somewhere to start googling) would be
> > gratefully received
>
> What version of Django are you using, and what is the type of the
> column in the database?  It sounds like you're most likely using a
> CLOB or a VARCHAR2, which won't be able to handle those characters
> since they aren't included in ISO-8859-1.  If the column is NCLOB or
> NVARCHAR2, then Django should handle the encoding conversions for you.
>
> 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-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 June 18, 2010 20:33:14

I.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Special characters and symbols in django?


On Jun 18, 3:42 am, "c.poll...@bangor.ac.uk" <c.poll...@bangor.ac.uk>
wrote:
> Django version 1.1.2 and yes the columns in questions are nclob and
> nvarchar
>
> The form i was using was to add the data was generated using model
> formset factory
>
> Are there characters django just can't cope with? Do i need to clean
> them out before saving the data?

No, Django uses unicode and utf8-encoded strings internally, so there
should be no problems.

This sounds like an Oracle-related issue to me, but have you verified
that the characters are still intact just before they are saved to the
database?

The problem sounds similar to me to the one described here:http://groups.google.com/group/django-users/browse_thread/thread/fb812a572168bfc8?hl=enYou might want to peruse that thread and see if any of the suggestions
there are applicable to your case. If it is an NLS_LANG issue of some
sort, then switching to a unicode build of cx_Oracle should hopefully
clear it up.

HTH,
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-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » Special characters and symbols in django? [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support