Solved

Reading foreign language using File system object in VB

Posted on 2006-06-23
1
194 Views
Last Modified: 2010-04-07
I have foreign language (Korean / Chinese) in a text file. Using File System object I am readling each line within the text file which is | (pipe) separated. The Readline method that is used is unable to read the foreign language data, English text is properly read.

Is there any way I can handle this?
0
Comment
Question by:Yogeshup
1 Comment
 
LVL 22

Accepted Solution

by:
danaseaman earned 500 total points
ID: 16969559
You must use "TristateTrue" or "TristateUseDefault" Flag to read Unicode. Having said that how are you displaying the strings? You need to use Forms 2.0 Object Library (comes with MS Office) controls or 3rd party Unicode aware controls. The Vb intrinsic controls will not display Unicode.

Private Const ForReading As Long = 1
Public Enum TristateEnum
   TristateTrue = -1        'Opens the file as Unicode
   TristateFalse = 0        'Opens the file as ASCII
   TristateUseDefault = -2  'Use default system setting
End Enum

Set objStream = objFSO.opentextfile(sFileName, ForReading, False,TristateTrue)

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now