printing special characters to file

S

shyPotter

Hi,

I have some text in non English (e:g Arabic/Urdu/Hindi etc) language. When I
am using file system object to or normal file system to write that text to
file I get error, same code with english characters works fine.

Any idea how to solve this.

Regards
 
A

Anthony Jones

shyPotter said:
Hi,

I have some text in non English (e:g Arabic/Urdu/Hindi etc) language. When I
am using file system object to or normal file system to write that text to
file I get error, same code with english characters works fine.

Any idea how to solve this.


You need to ensure the file is written in unicode format. When using the
CreateTextFile method make sure you pass a boolean True as the third
parameter:-

Dim fso: Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set oStream = fso.CreateTextFile(sFilePath, True, True)

This informs the stream to write characters as Unicode.

What errors were you getting?
 
S

shyPotter

Thanks Anthony , it works

cheers

Anthony Jones said:
You need to ensure the file is written in unicode format. When using the
CreateTextFile method make sure you pass a boolean True as the third
parameter:-

Dim fso: Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set oStream = fso.CreateTextFile(sFilePath, True, True)

This informs the stream to write characters as Unicode.

What errors were you getting?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top