Results 1 to 11 of 11

Thread: [RESOLVE] How to read an UTF-8 text file?

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2005
    Location
    China
    Posts
    23

    Unhappy [RESOLVE] How to read an UTF-8 text file?

    I wrote some chinese words in NOTEPAD, then save as UTF-8 coding.
    When I open it in VB, all of chinese words changed to wrong chars, can't read.
    I must save it as UTF-8 coding.
    Please help me , I will thank you !

    VB Code:
    1. Dim FileHandle As Integer
    2.     Dim Contents As String
    3.     FileHandle = FreeFile
    4.     Open filename For Binary As #FileHandle
    5.         Contents = Input(LOF(FileHandle), #FileHandle) & vbCrLf
    6.     Close #FileHandle
    7.     LoadFileEx = Contents
    ---------------------------------------
    我在一个记事本中输入一些中文后保存为UTF-8编码文档,
    我在VB中打开他的时候,中文都变成乱码了,不能阅读。
    必须保存为UTF-8编码
    请帮助我,谢谢。
    Last edited by lichkingCN; Oct 29th, 2005 at 05:18 AM. Reason: resolve
    Don't walk before me I may not follow.
    Don't walk behind me I may not lead.
    Walk beside me and be my friend.


    ICQ number: 325052114

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width