Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Strange encoding behaviour

Reply
Thread Tools

Strange encoding behaviour

 
 
Antonio
Guest
Posts: n/a
 
      12-29-2004
Good Morning,
I've the following problem :

I want to translate some page of my site using babelfish translator of
Altavista,
To avoid manual job I want to deliver a c# script that produce this
result.

I've putted this page on my site at the url
http://www.etantonio.it/EN/Economia/indexTest.aspx

////////////////////////////////////////////////////////
<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/babel...indexTest.aspx
and it's working OK, the translation of Economy in French is …conomie
, the problem is in the first letter of …conomie
, the … is not well recognized instead by the following my c# script

///////////////////////////////////////////////////////////////////////////////
<%@ Page Language="c#" debug="true" trace="true"
ResponseEncoding="utf-8"%>
<%@ 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/babelfish/trurl_pagecontent?doit=done&tt=url&intl=1&lp=en_fr &url=http%3A%2F%2Fwww.etantonio.it%2Fen%2Feconomia %2FindexTest.aspx"
;
WebRequest req = WebRequest.Create(sAddress);
WebResponse result = req.GetResponse();
Stream ReceiveStream = result.GetResponseStream();
StreamReader reader = new StreamReader(ReceiveStream, Encoding.UTF8
);
String sHtmlTradotto = reader.ReadToEnd();
Trace.Write("sHtmlTradotto", sHtmlTradotto);
}
</script>
///////////////////////////////////////////////////////////////////////////////


whose result is available at the url

http://www.etantonio.it/Utility/Trad...FrRidotto.aspx

and basically shows that the … of …conomie is blanked.

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

I think the problem is not in the code because if I use it for this
other address string

String sAddress =
"http://www.etantonio.it/Utility/Traduzioni/FR.aspx" ;


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

Engineer Antonio D'Ottavio
www.etantonio.it/en
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
debugger behaviour different to execution behaviour Andy Chambers Java 1 05-14-2007 09:51 AM
Strange behaviour with UTF-8 encoding liam_weston@hotmail.com ASP General 4 02-13-2006 11:19 AM
Strange encoding behaviour Antonio ASP .Net 0 12-29-2004 02:48 PM
Strange encoding behaviour Antonio ASP .Net 0 12-29-2004 02:45 PM
Encoding.Default and Encoding.UTF8 Hardy Wang ASP .Net 5 06-09-2004 04:04 PM



Advertisments