Strange encoding behaviour

A

Antonio

Hy Jon,
Still some problem, because I want to use also the chinese translation
for the page
http://www.etantonio.it/EN/Economia/indexTest.aspx
whose code is the following :

////////////////////////////////////////////////////////
<html>
<title>Economy</title>
</head>
<body>
<p align="center">Economy</p>
</body>
</html>
////////////////////////////////////////////////////////


If I try to translate this using altavista, the result is directly
available at
the url http://babelfish.altavista.com/babe...//www.etantonio.it/en/economia/indexTest.aspx
For this I've seen (... I know it is strange) the response has
charset=ISO-8859-1 .
If I use the same script working on french languages, the result does
not contain these chinese characters.
Here it is the script


///////////////////////////////////////////////////////////////////////////////
<%@ Page Language="c#" debug="true" trace="true"%>
<%@ import Namespace="System" %>
<%@ import Namespace="System.IO" %>
<%@ import Namespace="System.Net" %>
<script runat="server">
void Page_Load(Object Src, EventArgs E )
{
String sAddress =
"http://babelfish.altavista.com/babe...//www.etantonio.it/en/economia/indexTest.aspx"
;
WebRequest req = WebRequest.Create(sAddress);
WebResponse result = req.GetResponse();
Stream ReceiveStream = result.GetResponseStream();
StreamReader reader = new StreamReader(ReceiveStream,
Encoding.GetEncoding(28591));
String sHtmlTradotto = reader.ReadToEnd();
Trace.Write("sHtmlTradotto", sHtmlTradotto);
}
</script>
///////////////////////////////////////////////////////////////////////////////


whose result is available at the url

http://www.etantonio.it/Utility/Traduzioni/TraduttoreAltavistaPaginaWebEnFrRidotto.aspx

How can I solve the problem and finally obtain this translation ??

Can you help me ???
Many thanks in any case ...

Engineer Antonio D'Ottavio
www.etantonio.it/en
(e-mail address removed)
 
J

Jon Skeet [C# MVP]

Antonio said:
Still some problem, because I want to use also the chinese translation
for the page
http://www.etantonio.it/EN/Economia/indexTest.aspx
whose code is the following :

////////////////////////////////////////////////////////
<html>
<title>Economy</title>
</head>
<body>
<p align="center">Economy</p>
</body>
</html>
////////////////////////////////////////////////////////

If I try to translate this using altavista, the result is directly
available at
the url
http://babelfish.altavista.com/babelfish/trurl_pagecontent?doit=done
&tt=url&intl=1&lp=en_zh&url=http%3A%2F%2Fwww.etantonio.it%2Fen%2Fecono
mia%2FindexTest.aspx

I suspect that really *is* UTF-8. Basically, it seems that Babelfish
isn't terribly helpful when it comes to encodings... web browsers must
be automatically guessing it based on the content, which is pretty
unreliable :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top