p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: how to read a file content which is Unicode format


Message #1 by "Jessica Ma" <jessica_ma@e...> on Fri, 15 Mar 2002 02:18:35
I have a text file in unicode format, (GB5- Chinese simplified ). When I 
read it using the following code:

    <%
     strTextFile = server.MapPath("news1.txt")
     Set objFSO = Server.CreateObject("Scripting.FileSystemObject")'
	%>
   
    <%
     Set objTStream = objFSO.OpenTextFile(strTextFile,1,False,-1)
    Do While Not objTStream.AtEndOfStream
       strLinetext = objTStream.ReadLine	
       response.write strLineText & vbCrLf
    Loop
     objTStream.Close
     %>


it does not display correctly. 

What's the right way to fix it?

  Return to Index