views:

174

answers:

1

Hi, I wrote a shell script and created a spool file during programming for saving the data. By default file is saved in ANSI format. But I want to save the generated file in UTF 16 format so that all the special characters will properly saved.

Waiting for a quick reply!!

Thanks in advance. Abhijeet

A: 

What shell? What operating system? Please provide more context.

Unix, ok. Check this link

Unix creates files with the encoding defined by the current locale.

cdonner
It is unix based shell script. I am connecting to a database and running a select query in script. The output of this query, i am saving in a spool file. Now since there are many special characters present in db so i want to save the file in UTF16 format.
What database are you using? You may have to set the encoding of your database client as well. You have to make sure that from the encoding is correct all the way.It is also possible that the application that writes to the datbase does not encode the data correctly for storage.
cdonner