473,386 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to read a text file populated by multi-byte chars(e.g. Chinese chars )?

Hi,everybody,

If I create a text file like "Sub WriteTextFile" I can read the file
"file1.txt" using "Sub ReadTextFile" correctly, Whereas If I create the same
text file using NotePad.exe I can only read out these 2 strings: " is a
Chinese person's name" and "English". Need I make some conversion?

Private Sub WriteTextFile
Dim file1 As New StreamWriter("file1.txt")

With file1
.WriteLine("ÕÅÁ¢Ð is a Chinese person's name")
.WriteLine("English")
.Close()
End With
End Sub

Private Sub ReadTextFile
Dim file2 As New System.IO.StreamReader("file1.txt")
Dim words As String = file.ReadToEnd()
file.Close()
End Sub

Thanks in advance,
Peter

Nov 1 '06 #1
0 1145

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kobi Lurie | last post by:
Hello all, I'm trying to make a simple script beginner level script, with just functions. it uses the functions: file_get_contents substr taking into an array the text substr took then...
4
by: see_mun_lee | last post by:
I use asp to develop a web page to read an excel file containing Chinese Character then display it in the web page. Unfortunately, I cant display it!!! it will display (?????????). <META...
0
by: Larry Neylon | last post by:
Hi, I'm writing a vbscript application that reads UTF-8 XML containing Chinese characters. Any suggestions how to store these characters in MySql 4.0.x ? Do I need to set a special encoding...
1
by: Antonio | last post by:
With the following page aspx I try to translate one my page from English to Chinese, using UTF8, the result Is that the Chinese characters do not come read correctly, if instead I insert directly...
8
by: Agnes | last post by:
In my .net ,i need to generate an xml file , however, user may input a chinese character, Then , the xml will got something unknow characters. the following is my code, Does anyone know how to...
3
by: Cheryl | last post by:
Hi! I am implementing a system that can read Chinese characters from a text file and do some string manipulations. Can anyone suggest a method on how I can do file I/O with Chinese? Thanks.
8
by: pabv | last post by:
Hello all, I am having a few issues with encoding to chinese characters and perhaps someone might be able to assist. At the moment I am only able to see chinese characters when displayed as...
3
by: msnews.microsoft.com | last post by:
Hey there, I'm having trouble reading Simple Chinese characters from an XML document in an ASP file, I want to update the database based on what is in the file. Everytime, I read in the...
0
by: =?Utf-8?B?TGluenox?= | last post by:
Hi, I have a MFC project here which require me to read chinese character from a text file and display them. However, the chinese txt file have to be save in unicode while my program cannot read...
4
by: Sebastian.Pawlus | last post by:
Hi, I have a problem with Chinese words coded in utf-8. I need to display Chinese marks/words with use of GD or IMagick libs. Chinese text that I need to display is written as plain text in .txt...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.