"jimbob" <jimbob DeleteThis @discussions.microsoft.com> wrote in message
news:060A9052-5C3C-477D-8F9E-C0782CD0F698@microsoft.com...
> Thanks for your response Anthony.
> The code that is being used to get the content from the text files is:
>
> <%
> Sub IncludeFile(strFileName, strDirectory)
> strPath = Server.MapPath(strDirectory & strFileName)
> set objFSO = CreateObject("Scripting.FileSystemObject")
> set objFile = objFSO.OpenTextFile(strPath, 1)
> While not objFile.AtEndOfStream
> strHTML = objFile.Readline
> response.Write(strHTML)
> Wend
> objFile.Close
> Set objFile=Nothing
> End Sub
> %>
>
Does the page that uses this function set the Response.CharSet?
Does it specify a codepage either in code or declarative?
Is the text file saved as UTF-8 (open it in notepad and select save as...
what encoding is set by default)?
FileSytemObject cannot correctly read UTF-8 files.
Use ADODB.Stream instead.
Here are my recommendations for character encoding (on any type of site but
especially multi-lingual).
Save all pages as UTF-8 ensure each declares codepage=65001.
All pages should set Response.CharSet = "UTF-8".
In your case your text file should be saved as UTF-8 encoding also. Use
this code to include contents in response:-
Dim oStream : Set oStream = CreateObject("ADODB.Stream")
oSteam.Type = 1 'Binary
oStream.Open
oStream.LoadFromFile strPath
Response.BinaryWrite oStream.Read()
oStream.Close
Any javascript or css for consumption clientside should likewise be saved
UTF-8.
--
Anthony Jones - MVP ASP/ASP.NET
>> Stay informed about: Problems with multiple languages in Windows 2003