A
Antonio
With the following page aspx
I try to translate one my page from English to Chinese, using UTF8,
the result Is that the Chinese characters do not come read correctly,
if instead I insert directly the address
http://babelfish.altavista.com/babe...ttp://www.etantonio.it/en/index.aspx&lp=en_zh
into the browser the page he comes shown correctly in Chinese, if i
save it and put it in my site and with the same below script I try to
read it and to save it always with utf8, the Chinese characters come
saves you normally, than problem there is to your opinion? My scope is
to save in automatic way in a file with extension aspx the content of
the page http://babelfish.altavista.com/babe...ttp://www.etantonio.it/en/index.aspx&lp=en_zh
hello and thanks....
Antonio D'Ottavio
www.etantonio.it
<%@ Page Language="c#" debug="true" trace="true"%>
<%@ import Namespace="System" %>
<%@ import Namespace="System.IO" %>
<%@ import Namespace="System.Net" %>
<script runat="server">
static string sLanguageSrc = "EN";
static string sLanguageDest = "ZH";
string PathDirectory ;
static FileInfo[] fi ;
void Page_Load(Object Src, EventArgs E )
{
String sAddressEncoded =
HttpUtility.UrlEncode("http://www.etantonio.it/en/index.aspx") ;
String sAddress =
"http://babelfish.altavista.com/babelfish/trurl_pagecontent?url=" +
sAddressEncoded + "&lp=" + sLanguageSrc + "_" + sLanguageDest ;
WebRequest req = WebRequest.Create(sAddress);
WebResponse result = req.GetResponse();
Stream ReceiveStream = result.GetResponseStream();
StreamReader reader = new StreamReader(ReceiveStream, Encoding.UTF8
);
String sHtmlTradotto = reader.ReadToEnd();
String RegStringSymError =
"(?i)\\<script\\slanguage=\"JavaScript\"\\>(\\s\\n)*\\<!--(\\s\\n)*function\\sSymError\\(\\)(\\s|\\n)*{(\\s|\\n)*return\\strue;(\\s|\\n)*}(\\s|\\n)*window.onerror\\s=\\sSymError;(\\s\\n)*//--\\>(\\s\\n)*\\</script\\>";
sHtmlTradotto = Regex.Replace(sHtmlTradotto, RegStringSymError,
"");
Trace.Write("sHtmlTradotto", sHtmlTradotto);
StreamWriter writer = new StreamWriter(
Server.MapPath("/Etantonio/EN/ZH_Tradotta.aspx") , false,
System.Text.Encoding.UTF8) ;
writer.Write(sHtmlTradotto);
writer.Flush();
writer.Close();
}
</script>
<html>
<head>
<title>Traduttore Cinese</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<META name="author" content="Antonio DOttavio">
<META name="keywords" content="Motore Ricerca Gif Animate, Animated
Gif, Gif Animate, Gif, Animated, WebMaster, Web, Azioni, Borsa,
Grafici, Criteri, Elettronica, Telecomunicazioni, Informatica,
Università, Economia, Finanza">
<meta name="description" content="Motore Ricerca Gif Animate, Animated
Gif">
<link href="../../Stili.css" rel="stylesheet" type="text/css">
</head>
<body>
</body>
</html>
I try to translate one my page from English to Chinese, using UTF8,
the result Is that the Chinese characters do not come read correctly,
if instead I insert directly the address
http://babelfish.altavista.com/babe...ttp://www.etantonio.it/en/index.aspx&lp=en_zh
into the browser the page he comes shown correctly in Chinese, if i
save it and put it in my site and with the same below script I try to
read it and to save it always with utf8, the Chinese characters come
saves you normally, than problem there is to your opinion? My scope is
to save in automatic way in a file with extension aspx the content of
the page http://babelfish.altavista.com/babe...ttp://www.etantonio.it/en/index.aspx&lp=en_zh
hello and thanks....
Antonio D'Ottavio
www.etantonio.it
<%@ Page Language="c#" debug="true" trace="true"%>
<%@ import Namespace="System" %>
<%@ import Namespace="System.IO" %>
<%@ import Namespace="System.Net" %>
<script runat="server">
static string sLanguageSrc = "EN";
static string sLanguageDest = "ZH";
string PathDirectory ;
static FileInfo[] fi ;
void Page_Load(Object Src, EventArgs E )
{
String sAddressEncoded =
HttpUtility.UrlEncode("http://www.etantonio.it/en/index.aspx") ;
String sAddress =
"http://babelfish.altavista.com/babelfish/trurl_pagecontent?url=" +
sAddressEncoded + "&lp=" + sLanguageSrc + "_" + sLanguageDest ;
WebRequest req = WebRequest.Create(sAddress);
WebResponse result = req.GetResponse();
Stream ReceiveStream = result.GetResponseStream();
StreamReader reader = new StreamReader(ReceiveStream, Encoding.UTF8
);
String sHtmlTradotto = reader.ReadToEnd();
String RegStringSymError =
"(?i)\\<script\\slanguage=\"JavaScript\"\\>(\\s\\n)*\\<!--(\\s\\n)*function\\sSymError\\(\\)(\\s|\\n)*{(\\s|\\n)*return\\strue;(\\s|\\n)*}(\\s|\\n)*window.onerror\\s=\\sSymError;(\\s\\n)*//--\\>(\\s\\n)*\\</script\\>";
sHtmlTradotto = Regex.Replace(sHtmlTradotto, RegStringSymError,
"");
Trace.Write("sHtmlTradotto", sHtmlTradotto);
StreamWriter writer = new StreamWriter(
Server.MapPath("/Etantonio/EN/ZH_Tradotta.aspx") , false,
System.Text.Encoding.UTF8) ;
writer.Write(sHtmlTradotto);
writer.Flush();
writer.Close();
}
</script>
<html>
<head>
<title>Traduttore Cinese</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<META name="author" content="Antonio DOttavio">
<META name="keywords" content="Motore Ricerca Gif Animate, Animated
Gif, Gif Animate, Gif, Animated, WebMaster, Web, Azioni, Borsa,
Grafici, Criteri, Elettronica, Telecomunicazioni, Informatica,
Università, Economia, Finanza">
<meta name="description" content="Motore Ricerca Gif Animate, Animated
Gif">
<link href="../../Stili.css" rel="stylesheet" type="text/css">
</head>
<body>
</body>
</html>