Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > html, unicode and character sets

Reply
Thread Tools

html, unicode and character sets

 
 
jb
Guest
Posts: n/a
 
      03-28-2006
If an html file is created in 16-bit unicode format and an appropriate
character set is used (e.g. GB2312, a flavor of chinese), will it
display correctly?

Will it be necessary to use any character codes?
 
Reply With Quote
 
 
 
 
Benjamin Niemann
Guest
Posts: n/a
 
      03-28-2006
jb wrote:

> If an html file is created in 16-bit unicode format and an appropriate
> character set is used (e.g. GB2312, a flavor of chinese), will it
> display correctly?


When using 16-bit encoding, you must configure your webserver correctly, so
it sends the encoding in the Content-Type HTTP header (Content-Type:
text/html; coding=GB2312).

I don't know though, if GB2312 belongs to the widely supported encodings -
i.e. if there are browsers that do not support it.

> Will it be necessary to use any character codes?


What do you mean by 'character codes'?

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
 
Reply With Quote
 
 
 
 
jb
Guest
Posts: n/a
 
      03-28-2006
> jb wrote:
>
>> If an html file is created in 16-bit unicode format and an appropriate
>> character set is used (e.g. GB2312, a flavor of chinese), will it
>> display correctly?

>
> When using 16-bit encoding, you must configure your webserver correctly, so
> it sends the encoding in the Content-Type HTTP header (Content-Type:
> text/html; coding=GB2312).


That makes sense. Will it work for local files?

>
> I don't know though, if GB2312 belongs to the widely supported encodings -
> i.e. if there are browsers that do not support it.
>
>> Will it be necessary to use any character codes?

>
> What do you mean by 'character codes'?
>


....codes like this: ö

I'm working on an html generator which isn't working properly for a
chinese user. Unicode support will be added if it solves the problem.
 
Reply With Quote
 
Benjamin Niemann
Guest
Posts: n/a
 
      03-28-2006
jb wrote:

>> jb wrote:
>>
>>> If an html file is created in 16-bit unicode format and an appropriate
>>> character set is used (e.g. GB2312, a flavor of chinese), will it
>>> display correctly?

>>
>> When using 16-bit encoding, you must configure your webserver correctly,
>> so it sends the encoding in the Content-Type HTTP header (Content-Type:
>> text/html; coding=GB2312).


I have to correct myself. GB2312 is a variable-length encoding which is
ASCII compatible. This means that it could be sufficient in most cases to
declare the encoding as
<meta http-equiv="Content-Type" content="text/html; coding=GB2312">. This
will only work, if the HTTP header does not contain the coding parameter.
It is still *strongly* recommended to declare the encoding in the HTTP
headers.

> Will it work for local files?


With a META element with the coding parameter this should also work for
local files (which is the only reason I could think of to use <meta
http-equiv..> at all).

>>> Will it be necessary to use any character codes?

>>
>> What do you mean by 'character codes'?
>>

>
> ...codes like this: &#246;


These are called 'character entity references'. You'll have to use these
whenever you need a character which is not available in GB2312.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      03-28-2006
Benjamin Niemann wrote:

> <meta http-equiv="Content-Type" content="text/html; coding=GB2312">. This
> will only work, if the HTTP header does not contain the coding parameter.


I think you mean "charset".

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Benjamin Niemann
Guest
Posts: n/a
 
      03-29-2006
Toby Inkster wrote:

> Benjamin Niemann wrote:
>
>> <meta http-equiv="Content-Type" content="text/html; coding=GB2312">. This
>> will only work, if the HTTP header does not contain the coding parameter.

>
> I think you mean "charset".


Oops. You're right.

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
 
Reply With Quote
 
 
 
Reply

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resolving unicode escapes to unicode character Tyler Ruby 1 07-29-2011 01:47 PM
File names, character sets and Unicode Michal Ludvig Python 1 12-12-2008 11:08 AM
Getting unicode escape sequence from unicode character? Kenneth McDonald Python 1 12-27-2006 10:27 PM
character sets? unicode? Michael Python 0 02-03-2005 05:22 PM
Java Newbie Question: Character Sets, Unicode, et al BLG Java 13 10-21-2003 08:07 PM



Advertisments