473,659 Members | 3,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Syst em" %>
<%@ import Namespace="Syst em.IO" %>
<%@ import Namespace="Syst em.Net" %>

<script runat="server">
static string sLanguageSrc = "EN";
static string sLanguageDest = "ZH";
string PathDirectory ;
static FileInfo[] fi ;

void Page_Load(Objec t Src, EventArgs E )
{
String sAddressEncoded =
HttpUtility.Url Encode("http://www.etantonio.i t/en/index.aspx") ;
String sAddress =
"http://babelfish.altav ista.com/babelfish/trurl_pageconte nt?url=" +
sAddressEncoded + "&lp=" + sLanguageSrc + "_" + sLanguageDest ;
WebRequest req = WebRequest.Crea te(sAddress);
WebResponse result = req.GetResponse ();
Stream ReceiveStream = result.GetRespo nseStream();
StreamReader reader = new StreamReader(Re ceiveStream, Encoding.UTF8
);
String sHtmlTradotto = reader.ReadToEn d();

String RegStringSymErr or =
"(?i)\\<script\ \slanguage=\"Ja vaScript\"\\>(\ \s\\n)*\\<!--(\\s\\n)*functi on\\sSymError\\ (\\)(\\s|\\n)*{ (\\s|\\n)*retur n\\strue;(\\s|\ \n)*}(\\s|\\n)* window.onerror\ \s=\\sSymError; (\\s\\n)*//--\\>(\\s\\n)*\\</script\\>";
sHtmlTradotto = Regex.Replace(s HtmlTradotto, RegStringSymErr or,
"");
Trace.Write("sH tmlTradotto", sHtmlTradotto);

StreamWriter writer = new StreamWriter(
Server.MapPath( "/Etantonio/EN/ZH_Tradotta.asp x") , false,
System.Text.Enc oding.UTF8) ;
writer.Write(sH tmlTradotto);
writer.Flush();
writer.Close();
}
</script>

<html>
<head>
<title>Tradutto re Cinese</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<META name="author" content="Antoni o DOttavio">
<META name="keywords" content="Motore Ricerca Gif Animate, Animated
Gif, Gif Animate, Gif, Animated, WebMaster, Web, Azioni, Borsa,
Grafici, Criteri, Elettronica, Telecomunicazio ni, Informatica,
Università, Economia, Finanza">
<meta name="descripti on" content="Motore Ricerca Gif Animate, Animated
Gif">
<link href="../../Stili.css" rel="stylesheet " type="text/css">
</head>

<body>
</body>
</html>
Jul 21 '05 #1
1 2143
Trying to display Chinese with the charset iso-8859-1? If you want to
display Chinese, all of your page must be in Unicode and not only just a
part of it, the other part being in italian.

Replace iso-8859-1 with utf-8 and take at the following two articles
(especially the end of the first one). The second one is there in case you
need to know the code page for UTF-8 (65001: Response.Codepa ge = 65001 or
Session.CodePag e=65001 but Reponse.CharSet ="UTF-8").

http://msdn.microsoft.com/library/de...taencoding.asp

http://support.microsoft.com/?kbid=232580

S. L.

"Antonio" <et*******@libe ro.it> wrote in message
news:ba******** *************** ***@posting.goo gle.com...
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="Syst em" %>
<%@ import Namespace="Syst em.IO" %>
<%@ import Namespace="Syst em.Net" %>

<script runat="server">
static string sLanguageSrc = "EN";
static string sLanguageDest = "ZH";
string PathDirectory ;
static FileInfo[] fi ;

void Page_Load(Objec t Src, EventArgs E )
{
String sAddressEncoded =
HttpUtility.Url Encode("http://www.etantonio.i t/en/index.aspx") ;
String sAddress =
"http://babelfish.altav ista.com/babelfish/trurl_pageconte nt?url=" +
sAddressEncoded + "&lp=" + sLanguageSrc + "_" + sLanguageDest ;
WebRequest req = WebRequest.Crea te(sAddress);
WebResponse result = req.GetResponse ();
Stream ReceiveStream = result.GetRespo nseStream();
StreamReader reader = new StreamReader(Re ceiveStream, Encoding.UTF8
);
String sHtmlTradotto = reader.ReadToEn d();

String RegStringSymErr or =
"(?i)\\<script\ \slanguage=\"Ja vaScript\"\\>(\ \s\\n)*\\<!--(\\s\\n)*functi on\\sSymError\\ (\\)(\\s|\\n)*{ (\\s|\\n)*retur n\\strue;(\\s|\ \n)*}(\\s|\\n)* window.onerror\ \s=\\sSymError; (\\s\\n)*//--\\>(\\s\\n)*\\</script\\>";
sHtmlTradotto = Regex.Replace(s HtmlTradotto, RegStringSymErr or,
"");
Trace.Write("sH tmlTradotto", sHtmlTradotto);

StreamWriter writer = new StreamWriter(
Server.MapPath( "/Etantonio/EN/ZH_Tradotta.asp x") , false,
System.Text.Enc oding.UTF8) ;
writer.Write(sH tmlTradotto);
writer.Flush();
writer.Close();
}
</script>

<html>
<head>
<title>Tradutto re Cinese</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<META name="author" content="Antoni o DOttavio">
<META name="keywords" content="Motore Ricerca Gif Animate, Animated
Gif, Gif Animate, Gif, Animated, WebMaster, Web, Azioni, Borsa,
Grafici, Criteri, Elettronica, Telecomunicazio ni, Informatica,
Università, Economia, Finanza">
<meta name="descripti on" content="Motore Ricerca Gif Animate, Animated
Gif">
<link href="../../Stili.css" rel="stylesheet " type="text/css">
</head>

<body>
</body>
</html>

Jul 21 '05 #2

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

Similar topics

2
1767
by: Elvira Zeinalova | last post by:
In my application I need to make the report in different languages. I made a table for report parameters, like: create myTable ( language_id int not null, parameter char(50) null, constraint PK_lang_ID PRIMARY KEY (language_id)) and then tried: insert into myTable values(1, 'Bank info') - for English
1
2360
by: Anthony Liu | last post by:
I believe that topic related to Chinese processing was discussed before. I could not dig out the info I want from the mail list archive. My Python script reads some Chinese text and then split a line delimited by white spaces. I got lists like
8
3481
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 solve it ?? Private Sub Init() With AMSXML ..Formatting = Formatting.Indented ..Indentation = 4 ..IndentChar = " " ..WriteStartDocument()
3
23861
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 converted the mdb to version 2002 under MS Access XP Polish and under this version everything works OK. The problem starts when I copy the mdb file to Windows XP EN and start it with MS Access XP EN. I get following error: "The expression On...
4
3154
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 those read from xml file works correct. How can I fix this problem? Thanks
1
281
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 the address http://babelfish.altavista.com/babelfish/trurl_pagecontent?url=http://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...
0
2715
by: slchslch | last post by:
Hi all, I have search through multiple forum to look for the respective solution for this problem but still i do not find any solution to this problem. I have Samsung SGH-D520 on hand which is able to display the Chinese & Thai font on the phone menu's by using the pre-set system language. Using the same code in java J2ME game to display english, chinese and thai character, the result was it failed to display any single Chinese & Thai...
12
8445
by: Atlas | last post by:
I'm working on a multilanguage ASP/HTML site using a IIS6 web server. It perfectly works with two languages (english and italian) in this way: - basically the same ASP code for every language - language-specific content is stored in text files, every language has it's own directory contents. - to enhance usability and formatting the language-specific contents are stored with html syntax; basically the code that normally stands between...
9
14134
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: articleArea.InnerHtml = article.Text . . .. and it works fine (shows chinese characters). But when I put this data into a asp:textbox control, it just shows up as is... (12大&# etc...) Can anyone tell me how to get the characters to appear...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8337
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8748
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.