File encoding UTL_FILE [message #504077] |
Thu, 21 April 2011 07:41  |
Manoj.Gupta.91
Messages: 239 Registered: March 2008 Location: Delhi
|
Senior Member |
|
|
Hi All,
I'm using
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
I'm creating a file using UTL_FILE.FOPEN and UTL_FILE.PUTF
But I don't know the file I created is in which encoding ASCII, UTF-8, EBCDIC etc.
1.) How can I create files in my desired encoding using UTL_FILE?
2.) Does UTL_FILE use database encoding? If yes then how to find out database encoding?
3.) Which encoding is used by UTL_FILE by default?
Thanks & Regards
Manoj
|
|
|
|
Re: File encoding UTL_FILE [message #504213 is a reply to message #504080] |
Fri, 22 April 2011 03:19   |
Manoj.Gupta.91
Messages: 239 Registered: March 2008 Location: Delhi
|
Senior Member |
|
|
Hi,
I actually don't know the right way to find out any file's encoding. What I do is
1. Open that file in NOTEPAD.
2. Choose Save As from file menu.
It shows me the encoding. I assume that this is my file's encoding. I can change it from there also.
But I want my files to be automatically generated by UTL_FILE in my desired encoding.
Q1. Am I doing it in a right way to find out file's encoding? Please suggest me the right way. Any DOS command etc.
Q2. In documentation I didn't find default encoding style of a file generated using UTL_FILE. Can you help me to find out.
I've already searched in GOOGLE but didn't find any suitable answer.
Please help me to resolve this issue.
Thanks & Regards
Manoj
|
|
|
Re: File encoding UTL_FILE [message #504223 is a reply to message #504213] |
Fri, 22 April 2011 07:16   |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
The file be in the encoding correspondent to what NLS_LANG was set to on the OS where you started the procedure.
Also, depending on the content of the file, there are a lot of encodings that look pretty much identical unless there is a specific character in the file. For example an ASCII file and an UTF-8 are exactly identical when there are just "normal" letters and number in it. So it is not really possible to determine an encoding 100% sure only form a sample file. (unless EVERY character possible in an encoding is in the sample file)
|
|
|
|