|
-
October 30th, 2006, 02:59 AM
#1
how to save file in UTF-16 encoding format in Vb.net
Hi all,
In vb.net when we save unicode files by default it is saved in UTF-8 , can any one tell me how to save the files in UTF-16 encoding format...
Regards
Gopikris.
-
October 30th, 2006, 04:35 AM
#2
Re: how to save file in UTF-16 encoding format in Vb.net
I think you can use the StreamWriter :
Code:
Dim sw As New IO.StreamWriter("c:\hannes.txt", True)
MessageBox.Show(sw.Encoding.ToString())
sw.Close()
gopala_kris Please do not post the same question over and over again. All questions in this forum deserves a fair chance to get answers, people will answer your question in due time.
I have removed all the double posted threads.
-
October 30th, 2006, 07:18 AM
#3
Re: how to save file in UTF-16 encoding format in Vb.net
Code:
Dim sw As New IO.StreamWriter("c:\hannes.txt", True, System.Text.Encoding.UTF32)
sw.WriteLine("Hello")
sw.Close()
-
October 30th, 2006, 07:20 AM
#4
Re: how to save file in UTF-16 encoding format in Vb.net
 Originally Posted by hannes
Dim sw As New IO.StreamWriter("c:\hannes.txt", True)
MessageBox.Show(sw.Encoding.ToString())
sw.Close()
this gives the default encoding used by the streamwriter to write into a file, not the encoding used by the file.
-
November 6th, 2006, 01:07 AM
#5
Re: how to save file in UTF-16 encoding format in Vb.net
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|