Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8987693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:51:24+00:00 2026-06-15T21:51:24+00:00

I have a text file saved as UTF-8 and when I try to read

  • 0

I have a text file saved as UTF-8 and when I try to read the file it gives me weird characters and not the correct characters (it contains Chinese characters). How can I make it give me the correct Chinese characters?

Option Explicit

Dim objFSO, strTextFile, strData, strLine, arrLines, aniTextFile, aniData, aniLines, aniLine, objTextFile, fso, inputFileList, listFile, fname
Dim iim1, iret, iret2, iret3, i
Const ForReading   = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")
strTextFile = "C:\Users\admin\Desktop\ArtistCG\folder.txt"
strData = objFSO.OpenTextFile(strTextFile,ForReading).ReadAll
arrLines = Split(strData,vbCrLf)

aniTextFile = "C:\Users\admin\Desktop\ArtistCG\folder-list.txt"
aniData = objFSO.OpenTextFile(aniTextFile,ForReading).ReadAll
aniLines = Split(aniData,vbCrLf)

For i = 0 To UBound(arrLines)
  strData = objFSO.OpenTextFile(arrLines(i),ForReading).ReadAll
  WScript.Echo strData

  Set listFile = objFSO.OpenTextFile(aniLines(i),ForReading)
  Do While Not listFile.AtEndOfStream
    fName = listFile.ReadLine
    WScript.Echo fName
  Loop
  listFile.Close
Next 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:51:25+00:00Added an answer on June 15, 2026 at 9:51 pm

    From the documentation:

    The FSO can read only ASCII text files. You cannot use the FSO to read
    Unicode files or to read binary file formats such as Microsoft Word or
    Microsoft Excel.

    Since you got weird characters, I guess that’s somewhat incorrect and the file was read in some 8-bit windows code page because if it really could read only ASCII, you would have seen ????

    Anyway, if you can use ADO, you can do this:

    Dim objStream, strData
    
    Set objStream = CreateObject("ADODB.Stream")
    
    objStream.CharSet = "utf-8"
    objStream.Open
    objStream.LoadFromFile("C:\Users\admin\Desktop\ArtistCG\folder.txt")
    
    strData = objStream.ReadText()
    
    objStream.Close
    Set objStream = Nothing
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a blob saved in my database (a text file). I can retrieve
I have a plain text-file (.yml) that contains UTF-8 character sequences like this: foo:
I have a problem, I have a saved text file, I want to use
I have Text file that contains data separated with a comma , . How
I have a Java application were the user can create a text file and
I have a file saved as UTF-8, and i'm reading it like this: ReadFile(hFile,
I have a Perl source file in utf-8 encoding, LF ending. It contains English
I have a upload text file field, and with it I plan to save
I have text file with some stuff that i would like to put into
I have text file with something like first line line nr 2 line three

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.