Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


[HELP ME]How to read a text file encoded in Chinese BIG5 ?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,35640
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> [HELP ME]How to read a text file encoded in Chinese BIG5 ?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 [HELP ME]How to read a text file encoded in Chinese BIG5 ? - 6/21/2006 8:19:52 PM   
  big5

 

Posts: 3
Score: 0
Joined: 6/15/2006
Status: offline
I'm from Chinese mainland,my computer's OS  Language is simplified Chinese,When I use VBS to open a text file encoded in BIG5,it's unreadable,just like this:
 
quote:



有關詞彙修正的補充資料:
程式會從文件前端開始讀取內容,同時對照詞庫內有沒有相同字串
(對照時以較長的字串為優先),若找到相同的便會進行替換及
跳到該字串尾後繼續搜尋及轉換,全篇文章從首至尾只讀取一次。
下面是參巧例子:


 
How can I convert it to Chinese GB or Unicode mode?
OR, you can tell me how to get the text file's content in any other way ?
 
I use VBS like this to read a text file:
 

      
 
 

Thanks anyway!
 
 
Post #: 1
 
 RE: [HELP ME]How to read a text file encoded in Chinese... - 6/22/2006 1:53:34 AM   
  mikeock


Posts: 124
Score: 1
Joined: 6/8/2006
Status: offline
According to vbscript programmer's reference you have the following properties for OpenTextFile.


OpenTextFile(filename,iomode,create,format)

The main item here that concerns you is the format.
The available options are
0 - default open in ASCII
- - open in unicode
-2 - open with sytem default format.

So your line should look like

Set objFile = objFSO.OpenTextFile("Readme.txt",ForReading,Fasle,-) 'for unicode.

Hope this helps!

_____________________________

My sig sucks!

(in reply to big5)
 
 
Post #: 2
 
 RE: [HELP ME]How to read a text file encoded in Chinese... - 6/22/2006 12:26:02 PM   
  big5

 

Posts: 3
Score: 0
Joined: 6/15/2006
Status: offline
quote:

ORIGINAL: mikeock

According to vbscript programmer's reference you have the following properties for OpenTextFile.


OpenTextFile(filename,iomode,create,format)

The main item here that concerns you is the format.
The available options are
0 - default open in ASCII
- - open in unicode
-2 - open with sytem default format.

So your line should look like

Set objFile = objFSO.OpenTextFile("Readme.txt",ForReading,Fasle,-) 'for unicode.

Hope this helps!


TO  mikeock:
Thanks for your reply first.
It doesn't work! Because the text file was encoded in BIG5,not unicode .

(in reply to mikeock)
 
 
Post #: 3
 
 RE: [HELP ME]How to read a text file encoded in Chinese... - 6/22/2006 11:56:37 PM   
  ebgreen


Posts: 4970
Score: 31
Joined: 7/12/2005
Status: offline
I've never done this, but if it is straight text, I wonder if there would be some way to open it in Word?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to big5)
 
 
Post #: 4
 
 RE: [HELP ME]How to read a text file encoded in Chinese... - 6/24/2006 2:23:19 PM   
  big5

 

Posts: 3
Score: 0
Joined: 6/15/2006
Status: offline
quote:

ORIGINAL: ebgreen

I've never done this, but if it is straight text, I wonder if there would be some way to open it in Word?


Thanks for your Reply First.

I'm sorry for my poor english,It seems you mistook my meaning.

I means, For example, your PC's OS language is English, My PC's OS language is  Simplified Chinese, I sent a text file that encoded in Simplified Chinese (GB2312),When you open that file,you may found it's gibberish(OR "Messy code"? I don't know how to describe it),It's unreadable signal .

so,you must convert it to English Coding (ISO , Windows ,OR Unicode? I don't know exactly . ) first, right?

My question is , how to convert it in VB Script?

Thanks a lot .

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: [HELP ME]How to read a text file encoded in Chinese... - 6/26/2006 3:00:34 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
im pretty sure that no one will be able to view it properly without the right font/language pack installed

is that what you are asking?

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to big5)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> [HELP ME]How to read a text file encoded in Chinese BIG5 ? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts