From: shyPotter on
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


From: Anthony Jones on
"shyPotter" <someone(a)noone.com> wrote in message
news:um4gWIBiIHA.3780(a)TK2MSFTNGP06.phx.gbl...
> 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?


--
Anthony Jones - MVP ASP/ASP.NET


From: shyPotter on
Thanks Anthony , it works

cheers

"Anthony Jones" <Ant(a)yadayadayada.com> wrote in message
news:ee9HgVRiIHA.5900(a)TK2MSFTNGP02.phx.gbl...
> "shyPotter" <someone(a)noone.com> wrote in message
> news:um4gWIBiIHA.3780(a)TK2MSFTNGP06.phx.gbl...
>> 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?
>
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>


 | 
Pages: 1
Prev: Trading Forex
Next: Regex replace