Main Menu

HTML Help Required

Started by Adrian Bamforth, 14 March, 2008, 10:11:31 AM

Previous topic - Next topic

Adrian Bamforth

Hi all, I need to put some foreign text on a web site, in a few languages actually including Chinese, Japanese and Russian. When I cut and paste the text from another web site if turns into regular characters and/or gibberish. I've looked in their html and can't seem to find the piece of code that turns it into foreign alphabets (or perhaps I have to use the right font?). It's probably very easy, what should I do?

Thanks in advance,

ADE

johnnystress

Does it depend on the you/user having that font installed? Is there some way of embedding the fonts maybe

Noisybast

AFAIK, if the person viewing the site doen't have the correct font and/or language pack installed, it won't display properly.
Is it something you could do as an image?
Dan Dare will return for a new adventure soon, Earthlets!

Funt Solo

As I understand it, there is currently no way to force a user to have particular fonts on their machine.

Could character entities be your answer:

http://webdesign.about.com/od/localization/l/blhtmlcodes-ru.htm



++ A-Z ++  coma ++

Funt Solo

Yeah - that sounds like the modern solution - make sure you're using a Unicode charset, so get the correct meta element in your <head>:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

Then make sure you're using a modern browser.

Then, if I've got this right, the code &21488; should produce a chinese character like this one: &21488;

I have no idea if that's worked until I press "Post Message".

++ A-Z ++  coma ++

Funt Solo

++ A-Z ++  coma ++

Funt Solo

Ah, no - it does work - I just tested it.  But, this web page is set to iso-8859-1 (latin character set) instead of utf-8 (unicode) so we can't see it working here.

++ A-Z ++  coma ++

Banners

I had to do an Arabic page once and after going through all the various options, the easiest thing in the end was just to use a jpeg.

M@

Funt Solo

Here it is working: http://l511124.cct.abertay.ac.uk/foreignChar/">Chinese characters on a web page.

Tested on IE6 and Firefox 2, so assume it works in all modern browsers.

Simple as altering the charset (as posted above) and then finding out what the entity codes are for each particular character.

Character entity listings:

http://www.w3schools.com/html/html_entities.asp (and see various NEXT buttons)

http://www.w3.org/TR/html401/sgml/entities.html

---

It's all a bit patchy, though, so mbanners solution may be the most feasible until we de-Babel the Interwebz.
++ A-Z ++  coma ++

Adrian Bamforth

Well here's the web site I have to re-build. Clicking on the flag buttons brings up a pop-up translation, some Chinese, Japanese and Russian. It works on the computers I'd used, and as one can see it's selectable text not an image. When I copy and paste it it doesn't work and looking through the html I can't seem to isolate what makes it work.

Link: http://www.integrityagency.co.uk/" target="_blank">Integrity


Funt Solo

That is weird - they show up in the source code via Firefox as they look on the web page, but in Notepad, most of them show up as boxes, and in Notepad2, they all show up as unknown characters.

It doesn't look like character entity use, because they usually show up in code as their code, not the character.

It's got me stumped.
++ A-Z ++  coma ++

johnnystress

Just write in in English but extra large and with added spaces-

the type equivalent of speaking loudly and slowly to foreigners

IndigoPrime

"That is weird - they show up in the source code via Firefox as they look on the web page, but in Notepad, most of them show up as boxes, and in Notepad2, they all show up as unknown characters."
That'll be because some apps are unicode-aware and some aren't. In TextEdit on the Mac, every single character shows up fine.