top_left top_right
bottom_left
Next Event: Unknown | Forum Rules | QGL Website | Event Registration
openFolder AusForums.com
iconwatfolderLineopenFolder LANs
iconwatfolderLineopenFolder QGL
iconwatfolderLineopenFolder QGL Forum
Author
Topic: html entites
mooby
Posts: 3694
Location: UK
anyone had experience with html enties?

i need to know how to convert utf-8 chars (chinese) to html enties like 节
system
--
Jim
Posts: 6886
Location: Brisbane, Queensland
http://au3.php.net/manual/en/function.htmlentities.php
mooby
Posts: 3696
Location: UK
thanks, found a great php article... just need a dot net framework one :S
Jim
Posts: 6887
Location: Brisbane, Queensland
don't have a language reference like the php manual?
Persay
Posts: 4681
Location: Other International
jim making serious posts is sooooooo confusing, you're supposed to just say things about 4wd and post "no u" whenever there's a serious debate going on
Jim
Posts: 6889
Location: Brisbane, Queensland
serious, like your momma lol
Opec
Posts: 4821
Location: Brisbane, Queensland
http://www.dotnetindex.com/articles/4088_Converting_all_applicable_characters_to_HTML_entities.asp
Jim
Posts: 6890
Location: Brisbane, Queensland
ahah that's php too
Opec
Posts: 4822
Location: Brisbane, Queensland
LOL
mooby
Posts: 3698
Location: UK
thanks guys, what a nightmare, still not solved. has to be done by monday :S

http://www.w3.org/TR/REC-html40/charset.html#encodings and http://www.unicode.org/unicode/faq/unicode_iso.html

That lists the entities as ISO10646.

Theres good articles on changing encodings,
http://msdn2.microsoft.com/en-us/library/system.text.encoding.getencodings.aspx

but dont seem to do to ISO10646 :S

hast
Posts: 861
Location: Brisbane, Queensland
just convert the string to utf32 (System.Text.Encoding.UTF32) iterate over the bytes in groups of 4 and convert them back to an int and do &#number; for each int

i think that is the bullet proof way to do it. you could also try and use Char.ConvertToUtf32 but there is some weirdness with surrogate pairs which will probably screw up asian languages.
mooby
Posts: 3700
Location: UK
thanks hast! day too late tho, found an article that just exactly what you said. : )
Jim
Posts: 6892
Location: Brisbane, Queensland
share
mooby
Posts: 3701
Location: UK
http://www.codeproject.com/useritems/htmlencodingcsharp.asp?df=100&forumid=453817&exp=0&select=2204551
system
--
Not a new post since your last visit.
New Post Since your last visit
Back To Forum
Advertise with Us | Privacy Policy | Contact Us
© Copyright 2001-2026 AusGamers Pty Ltd. ACN 093 772 242.
Hosted by Mammoth Networks - Australian VPS Hosting
Web development by Mammoth Media.