Click to See Complete Forum and Search --> : how to save file in UTF-16 encoding format in Vb.net
gopala_kris
October 30th, 2006, 01:59 AM
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.
HanneSThEGreaT
October 30th, 2006, 03:35 AM
I think you can use the StreamWriter :
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.
aniskhan
October 30th, 2006, 06:18 AM
Dim sw As New IO.StreamWriter("c:\hannes.txt", True, System.Text.Encoding.UTF32)
sw.WriteLine("Hello")
sw.Close()
aniskhan
October 30th, 2006, 06:20 AM
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.
gopala_kris
November 6th, 2006, 12:07 AM
Thank u all
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.