Advertisement

06.29.2008 at 06:47AM PDT, ID: 23524933
[x]
Attachment Details

Converting a UTF16 .csv file to a UTF8 .csv file

Asked by robmoel in VB Script, Windows Batch Scripting

Tags: vbscript

How do I convert a UTF16 .csv file to a UTF8 .csv file or ASCII file using vbscript?  I have a UTF16 .csv that has 1 line of data from which I cannot read file that I cannot read the line - it returns 3 characters of jibberish.

Here is my code that I am using currently


Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

Dim objTextStream

const strFileName = "C:\TestSubject-en-us.csv"

      Set objTextStream = objFSO.OpenTextFile(strFileName, 1)
      msgbox("" & objTextStream.ReadLine & "")
      'Response.Write "" & objTextStream.ReadAll & ""
      objTextStream.Close      
      Set objTextStream = Nothing

Set objFSO = NothingStart Free Trial
 
 
Loading Advertisement...
 
[+][-]06.29.2008 at 10:57AM PDT, ID: 21894865

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.29.2008 at 12:44PM PDT, ID: 21895246

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.29.2008 at 02:28PM PDT, ID: 21895539

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: VB Script, Windows Batch Scripting
Tags: vbscript
Sign Up Now!
Solution Provided By: RobSampson
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.29.2008 at 05:22PM PDT, ID: 21896027

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628