Problems with multiple languages in Windows 2003
Problems with multiple languages in Windows 2003
am 09.11.2007 14:27:02 von Jimbob
Hello,
Not sure if this is the right place for this question but hopefully someone
might be able to help.
We have a website that currently runs on a Windows 2000 server that can be
viewed in English, French and German.
We want to move this website to a new server running Windows 2003 and have
placed a copy of the website on this new server.
Unfortunately there are problems with the French and German versions, these
being that some national characters are not displaying properly and other
âoddâ characters i.e.  are being displayed. The content on the website
pages is from text files on the server and an Access database.
Any ideas as to why these characters show up on the website running on
Windows 2003 but not on Windows 2000 ?
Are we missing a setting on the Windows 2003 server?
Regards,
Paul.
Re: Problems with multiple languages in Windows 2003
am 09.11.2007 15:16:21 von Anthony Jones
"jimbob" wrote in message
news:3CCB3149-8B55-4C24-AC2F-565E1030804E@microsoft.com...
> Hello,
>
> Not sure if this is the right place for this question but hopefully
someone
> might be able to help.
> We have a website that currently runs on a Windows 2000 server that can be
> viewed in English, French and German.
> We want to move this website to a new server running Windows 2003 and have
> placed a copy of the website on this new server.
> Unfortunately there are problems with the French and German versions,
these
> being that some national characters are not displaying properly and other
> 'odd' characters i.e.  are being displayed. The content on the website
> pages is from text files on the server and an Access database.
> Any ideas as to why these characters show up on the website running on
> Windows 2003 but not on Windows 2000 ?
> Are we missing a setting on the Windows 2003 server?
>
One of the differences I know of in this area is related to ASP is that what
you are using?
In on 2000 ASP only had a Session.Codepage property and once set would
impact session wide how content written with Response.Write is encoded.
the <@ codepage=??? would set this property. Any ASP page not setting this
value would continue to use whatever is currently set for the session.
With 2003 the response object acquired the codepage property also. The @
codepage directive now affects the Response.codepage property not the
session. Hence any ASP page not declaring the codepage will use the default
session codepage.
The upshot is that ASP code that worked before may have only be working
properly because pages visited earlier had set the session codepage that it
ought to have been setting.
Also the 'odd' characters  are used at the start of a UTF-8 encoded file
and are know as the BOM. I'd need to know a little more about how you take
content from text files and access and deliver them to the client.
--
Anthony Jones - MVP ASP/ASP.NET
Re: Problems with multiple languages in Windows 2003
am 09.11.2007 15:59:02 von Jimbob
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
%>
Regards,
Paul.
"Anthony Jones" wrote:
> "jimbob" wrote in message
> news:3CCB3149-8B55-4C24-AC2F-565E1030804E@microsoft.com...
> > Hello,
> >
> > Not sure if this is the right place for this question but hopefully
> someone
> > might be able to help.
> > We have a website that currently runs on a Windows 2000 server that can be
> > viewed in English, French and German.
> > We want to move this website to a new server running Windows 2003 and have
> > placed a copy of the website on this new server.
> > Unfortunately there are problems with the French and German versions,
> these
> > being that some national characters are not displaying properly and other
> > 'odd' characters i.e.  are being displayed. The content on the website
> > pages is from text files on the server and an Access database.
> > Any ideas as to why these characters show up on the website running on
> > Windows 2003 but not on Windows 2000 ?
> > Are we missing a setting on the Windows 2003 server?
> >
>
> One of the differences I know of in this area is related to ASP is that what
> you are using?
>
> In on 2000 ASP only had a Session.Codepage property and once set would
> impact session wide how content written with Response.Write is encoded.
> the <@ codepage=??? would set this property. Any ASP page not setting this
> value would continue to use whatever is currently set for the session.
>
> With 2003 the response object acquired the codepage property also. The @
> codepage directive now affects the Response.codepage property not the
> session. Hence any ASP page not declaring the codepage will use the default
> session codepage.
>
> The upshot is that ASP code that worked before may have only be working
> properly because pages visited earlier had set the session codepage that it
> ought to have been setting.
>
> Also the 'odd' characters  are used at the start of a UTF-8 encoded file
> and are know as the BOM. I'd need to know a little more about how you take
> content from text files and access and deliver them to the client.
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>
>
Re: Problems with multiple languages in Windows 2003
am 09.11.2007 17:28:33 von Anthony Jones
"jimbob" 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