Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Adding Chinese in the body of an HTML file
Old 10-24-2007, 05:50 PM Adding Chinese in the body of an HTML file
Novice Talker

Posts: 7
Trades: 0
Hi, I was wondering if there is a way to add non-english (specifically, Chinese) into an html document so that it shows up on the webpage? I am writing the html on notepad, in english, and adding chinese gives me error msgs and question marks in the place where they should appear.

Just to clarify, in case this comes up -- I do have chinese on my computer and can see it normally / type it in other programs, however I don't know how to translate the characters into the html...

Thanks!
rasputinberry is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-24-2007, 06:31 PM Re: Adding Chinese in the body of an HTML file
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
I think you need to define the HTML charset. Probably your computer fall back on iso-9981-1, which is western european (ascii+accentuated characters).
You should use big5 or utf-8 for chineses:

Code:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
or
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-24-2007, 11:35 PM Re: Adding Chinese in the body of an HTML file
Novice Talker

Posts: 7
Trades: 0
I tried each of your suggestions in the <head>, but nothing seems to be affected. I wonder if I am implementing the chinese wrong? Maybe another tag is needed before and after the characters....... anyone know anything about this? o_o thanks in advance!
rasputinberry is offline
Reply With Quote
View Public Profile
 
Old 10-25-2007, 05:37 AM Re: Adding Chinese in the body of an HTML file
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
could you post your file, it will help.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-26-2007, 12:14 AM Re: Adding Chinese in the body of an HTML file
Novice Talker

Posts: 7
Trades: 0
Oh, really? I was under the impression that implementing chinese would be the same regardless of what was already coded..but I'm a true noob, so..hahaha x_x""

Here is the main page so far (the top portion is just to get popups working on the different pages, which i haven't made yet, and the actual content only consists of an image and small note within the body):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>
<title> Portfolio</title>
<link rel="stylesheet" href="css.css" type="text/css" />

<script language="JavaScript1.2" type="text/javascript">
<!-- ;
var newwindow;
var wheight = 0, wwidth = 0;

function popitup5(url, title, iwidth, iheight, colour) {
var pwidth, pheight;

if ( !newwindow || newwindow.closed ) {
pwidth=iwidth+30;
pheight=iheight+30;
newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
wheight=iheight;
wwidth=iwidth;
}

if (wheight!=iheight || wwidth!=iwidth ) {
pwidth=iwidth+30;
pheight=iheight+90;
newwindow.resizeTo(pwidth, pheight);
wheight=iheight;
wwidth=iwidth;
}

newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
newwindow.document.writeln('<img src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" >');
newwindow.document.writeln('<\/center> <\/body> <\/html>');
newwindow.document.close();
newwindow.focus();
}

// Routines to tidy up popup windows when page is left
// Call with an onUnload="tidy5()" in body tag

function tidy5() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}

// Based on JavaScript provided by Peter Curtis at www.pcurtis.com -->
</script>




</head>

<BODY onUnload="tidy5()" >



<div id="constraint">
<div id="banner">
</div>
<div id="links"><a href="index.html"> main</a> |
<a href="resume.html"> resume</a> |

<a href="reference.html"> reference</a> |

<a href="coverletter.html"> cover letter</a> |

<a href="projects.html"> projects </a> |
<a href="gallery.html"> gallery</a>
</div>

<div id="main">
<br />
<img src="img/front.jpg" />
<br /><br />


</div>

<div id="note">
Work may not be copied, reproduced or altered.
</div>

</div>


</body>
</html>
rasputinberry is offline
Reply With Quote
View Public Profile
 
Old 10-26-2007, 04:07 AM Re: Adding Chinese in the body of an HTML file
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
I've found some more infos there:
http://www.webmasterworld.com/forum21/11092.htm

Turns out several more modifications are needed, and a content-language meta tag.
As your file didn't had any chines characters in it, I could not test it, but there it goes:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="zh-CN" xml:lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml">
<http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="zh">  

<head>
<title>Portfolio</title>
<link rel="stylesheet" href="css.css" type="text/css" />

<script language="JavaScript1.2" type="text/javascript">
<!-- ;
var newwindow;
var wheight = 0, wwidth = 0;

function popitup5(url, title, iwidth, iheight, colour) {
var pwidth, pheight;

if ( !newwindow || newwindow.closed ) {
pwidth=iwidth+30;
pheight=iheight+30;
newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
wheight=iheight;
wwidth=iwidth;
}

if (wheight!=iheight || wwidth!=iwidth ) {
pwidth=iwidth+30;
pheight=iheight+90;
newwindow.resizeTo(pwidth, pheight);
wheight=iheight;
wwidth=iwidth;
}

newwindow.document.clear();
newwindow.focus();
newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
newwindow.document.writeln('<img src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" >');
newwindow.document.writeln('<\/center> <\/body> <\/html>');
newwindow.document.close();
newwindow.focus();
}

// Routines to tidy up popup windows when page is left
// Call with an onUnload="tidy5()" in body tag

function tidy5() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}

// Based on JavaScript provided by Peter Curtis at www.pcurtis.com -->
</script>




</head>

<BODY onUnload="tidy5()">



<div id="constraint">
<div id="banner"></div>
<div id="links"><a href="index.html"> main</a> | <a
    href="resume.html"> resume</a> | <a href="reference.html">
reference</a> | <a href="coverletter.html"> cover letter</a> | <a
    href="projects.html"> projects </a> | <a href="gallery.html">
gallery</a></div>

<div id="main"><br />
<img src="img/front.jpg" /> <br />
<br />


</div>

<div id="note">Work may not be copied, reproduced or altered.</div>

</div>


</body>
</html>
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-29-2007, 02:35 AM Re: Adding Chinese in the body of an HTML file
Novice Talker

Posts: 7
Trades: 0
I saved my file as as unicode encoding w/o changing anything else, and the chinese works in IE, yet not FF. I've tried the meta tag and there was as tiiny change (the chinese changed font style very slightly) but the FF version was still faulty. to be exact, the chinese appeared but for some reason the css didn't work. Any ideas???
rasputinberry is offline
Reply With Quote
View Public Profile
 
Old 10-29-2007, 05:46 AM Re: Adding Chinese in the body of an HTML file
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Did you saved your css file in an unicode charset too?
I know that some document have a BOM ( http://en.wikipedia.org/wiki/Byte_Order_Mark ), that can specify the charset, and maybe FF cannot mix both?
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Adding Chinese in the body of an HTML file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41914 seconds with 12 queries