Home » SQL & PL/SQL » Client Tools » Spool in UTF8 not always works (oracle 9i)
Spool in UTF8 not always works [message #528485] Tue, 25 October 2011 05:03 Go to next message
clairvoyant22
Messages: 3
Registered: October 2011
Junior Member
Hi,

I have a problem spooling flat files in utf 8. I have 3 different sql that needs to be spooled regulary in utf8 format.
the first two containing special chars is spooled without any problem, but the third that is containg only numbers and pipe-s is spooled in ansi format. |could you help me what can be the problem?

i have set nls_lang=.utf8 in my shell script, but that onlz helped at the first two sql the last doesnt work.

I have also tried to convert file using iconv command, but the output is still in ansi (only works if i put a special char in the ansi file then it converts to utf8 without problem)

if i open the file in notepad and save as utf8 then it works, but i cannnot reach the same from unix script. do u have any idea/suggestions?

thanks in advance,
clairvoyant
Re: Spool in UTF8 not always works [message #528490 is a reply to message #528485] Tue, 25 October 2011 05:12 Go to previous messageGo to next message
ThomasG
Messages: 3205
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
A file with only numbers and the pipe symbol would be completely identical in UTF-8, ansi and ascii, since all symbols are below code point 127 in ASCII.

What *notepad* especially seems to do when you save a file in UTF-8 is add the (optional) Byte Order Mark (BOM) at the beginning of the file.
Re: Spool in UTF8 not always works [message #528491 is a reply to message #528490] Tue, 25 October 2011 05:14 Go to previous messageGo to next message
clairvoyant22
Messages: 3
Registered: October 2011
Junior Member
thanks for the reply,

the file i am creating will be used for input and they are expecting it in utf8. do you think it will cause no problem in ansi also in this case?

cannot do the same from unix script what notepad does?

thanks
Re: Spool in UTF8 not always works [message #528493 is a reply to message #528491] Tue, 25 October 2011 05:19 Go to previous messageGo to next message
ThomasG
Messages: 3205
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
I don't think it will cause any problems. It's more likely the added notepad BOM will cause problems. (At least in my experience)

Since a pure ASCII file is identical to it's UTF-8 equivalent, as long as no special characters outside the 0-127 range are use.

Re: Spool in UTF8 not always works [message #528499 is a reply to message #528493] Tue, 25 October 2011 05:48 Go to previous message
clairvoyant22
Messages: 3
Registered: October 2011
Junior Member
thanks Thomas. tommorow i will give the files hopefully they will dont find any problem with that ansi file
Previous Topic: Ignore Sql prompt and command entered while spooling
Next Topic: Spool Output and Rollback.
Goto Forum:
  


Current Time: Sat Jan 20 06:04:54 CST 2018

Total time taken to generate the page: 0.01382 seconds