Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

insert characterset problems

696834Jun 12 2009 — edited Jun 23 2009
Hi

I am running a script that reads data from a local text file, parses it, and then do an INSERT with the parsed values.

The inserts run ok.

But, when I retrieve the values from the database I see strange characters instead of our Norwegian characters æ,ø,å.

Some info:
- The NLS_CHARACTERSET in the database is AL32UTF8.
- The database is Oracle XE 10.
- The OS is CentOS 5.3
- The file is saved as UTF in the Gedit Gnome editor.
- I open the file with open('filename.txt')
- Read all lines into a list with readlines()
- I parse all lines using [from:to] string splitting notation.
- And add to the INSERT using "INSERT into mytable values (%d, %s)" % (int(pn), ps).

I also print out the INSERT string just to make sure everything looks ok and it does, but when inside the database the characters æøå are weird.

Regards
Rune

Edited by: user10719935 on Jun 12, 2009 12:51 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 21 2009
Added on Jun 12 2009
1 comment
5,558 views