Archive

Posts Tagged ‘utf8’

Wrong characters using SQL Loader against an UTF8 database

February 8, 2011 2 comments

I have to load periodically data with SQL Loader. The source data is generated in a Windows environment, and I load the data in our servers (linux-based).

I have problems uploading special characters (Ñ, Ç, Á, …) because of the different NLS_LANG of the source data (ISO-8859, WE8ISO8859P1) and the NLS_LANG of the database (SPANISH_SPAIN.UTF8).

I’ve tried to convert the source data to UTF8 with iconv, but I still get wrong data.

Trying to specify the NLS_LANG in the control file does not work:


LOAD DATA
CHARACTERSET UTF8
INFILE ...

So finally, the solution that worked for me is to export NLS_LANG before uploading the data with SQL Loader:


export NLS_LANG=SPANISH_SPAIN.WE8ISO8859P1

sqlldr userid=user@database control=control_file.ctl log=log_file.log bad=bad_records.bad direct=true

And I get the correct data.

A few and interesting references about SQL Loader:

http://www.orafaq.com/wiki/SQL*Loader_FAQ

http://www.akadia.com/services/ora_sql_loader_utf8.html

“Save Failed, File cannot be created”, Lotus Notes 8.5.1 on Ubuntu 10.10 64 bits

January 28, 2011 Leave a comment

When I want to save an attachment in a Lotus Notes ad-hoc application, I’m getting this error.

I can open the attachment (via context menu – open), but I cannot save it. I neither can attach files to the application (in a rich text field of a document of the application).

This error is intermittent, now it let’s me save attachments, now not. This is annoying

I’ve read in some posts that finally it seems that Lotus Notes 8.5.2 works fine in ubuntu (32 bits). I’ll give it a try in ubuntu 64 bits.

Updated feb-11 2011

Finally I found the problem!

To be honest, the error wasn’t intermitent. It only happened when I tried to save a file that has special characters (ñ, ç, tildes like à, á, …) in the filename or in the folder I wanted to save it. My native language is catalan, so I have a lot of files like this.

I knew that I did something wrong to get this error, and I remembered that a couple of days ago I was messing with the locales, as I posted here https://myotragusbalearicus.wordpress.com/2011/01/28/howto-change-t…cale-in-ubuntu/ and I missed one thing.

After changing the locale via language selector (System -> Administration -> Language support), today I’ve noticed that my LANG was incorrect:


$ locale

LANG=ca_ES.we8iso885915
LC_CTYPE="ca_ES.utf8"
LC_NUMERIC="ca_ES.utf8"
LC_TIME="ca_ES.utf8"
LC_COLLATE="ca_ES.utf8"
LC_MONETARY="ca_ES.utf8"
LC_MESSAGES="ca_ES.utf8"
LC_PAPER="ca_ES.utf8"
LC_NAME="ca_ES.utf8"
LC_ADDRESS="ca_ES.utf8"
LC_TELEPHONE="ca_ES.utf8"
LC_MEASUREMENT="ca_ES.utf8"
LC_IDENTIFICATION="ca_ES.utf8"
LC_ALL=ca_ES.utf8

I checked again Language support and the text tab was empty (with no language selected). I selected Catalan again, applied to all the system and then reboot… but still doesn’t work!

Reviewing this bug in launchpad https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/553162 i checked again the locale and noticed thant LANG was still wrong. I exported it and reboot (assigning also the LANGUAGES environment variable), and now all works fine and I can save files from Lotus Notes. Now my locale looks like this:


$ locale
LANG=ca_ES.utf8
LANGUAGE=ca_ES@euro:ca
LC_CTYPE="ca_ES.utf8"
LC_NUMERIC="ca_ES.utf8"
LC_TIME="ca_ES.utf8"
LC_COLLATE="ca_ES.utf8"
LC_MONETARY="ca_ES.utf8"
LC_MESSAGES="ca_ES.utf8"
LC_PAPER="ca_ES.utf8"
LC_NAME="ca_ES.utf8"
LC_ADDRESS="ca_ES.utf8"
LC_TELEPHONE="ca_ES.utf8"
LC_MEASUREMENT="ca_ES.utf8"
LC_IDENTIFICATION="ca_ES.utf8"
LC_ALL=ca_ES.utf8