473,378 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Problem with Chinese

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/babel....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/babel....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.one rror\\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>
Nov 16 '05 #1
0 827

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Antonio | last post by:
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...
8
by: Agnes | last post by:
In my .net ,i need to generate an xml file , however, user may input a chinese character, Then , the xml will got something unknow characters. the following is my code, Does anyone know how to...
3
by: Stan | last post by:
Hallo, I have developed an application in MS Access 2000 (Polish version) under MS Windows XP prof (also Polish). Now I would like to run this code on MS Windows XP EN and MS Access XP EN. I have...
4
by: Daatmor | last post by:
I saved my aspx with Encoding (Chinese Tranditional (Big5) - Codepage 950) and I had set codepage="950" in Page tag. The content rendered incorrect (all text changed to symbols), but some content...
9
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
OK I have some Chinese text in sql server column that looks like this: 12大专题调研破解广东科学发展难题 This is unicode? Anyway, I put this data into a text area like this:...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.