HI,
In my VB application, I have to create a txt file, write the string into the
file and while saving need to set the Encoding of file to UTF-8. By default
it is ANSI. Is anybody know how to do this in VB?
Thanks & Regards,
Rama
Tony Proctor - 26 Apr 2005 09:50 GMT
You first need to convert the VB String data from Unicode to a UTF-8 byte
array (e.g. using something like:
http://www.google.ie/groups?safe=off&as_umsgid=%23%24QgKiUfDHA.2748@TK2MSFTNGP11
.phx.gbl&lr=lang_en&hl=en),
and then write it to your file using binary file I/O.
NB: Don't store UTF-8 data in String variables, only byte arrays (String
data should only hold real Unicode text). Also, don't use normal record I/O
to the file, use binary (this avoids any conversion of the data as ANSI)
Tony Proctor
> HI,
>
[quoted text clipped - 4 lines]
> Thanks & Regards,
> Rama