PC Review


Reply
Thread Tools Rate Thread

Strange encoding behaviour

 
 
Antonio
Guest
Posts: n/a
 
      29th Dec 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.pcreview.co.uk/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Does sql sever set this at the column data type level, server wide encoding setting, os encoding? Daniel Microsoft C# .NET 1 25th Mar 2007 05:47 PM
how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Does sql sever set this at the column data type level, server wide encoding setting, os encoding? Daniel Microsoft Dot NET Framework 1 8th Mar 2007 12:06 PM
how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Does sql sever set this at the column data type level, server wide encoding setting, os encoding? Daniel Microsoft ADO .NET 0 8th Mar 2007 12:15 AM
how does ado.net SqlDataReader.GetString() know which encoding to read the data into a string as? Does sql sever set this at the column data type level, server wide encoding setting, os encoding? Daniel Microsoft Dot NET 0 8th Mar 2007 12:12 AM
Strange encoding behaviour Antonio Microsoft ASP .NET 0 29th Dec 2004 03:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:05 AM.