August 20th, 2003, 10:20 PM
character to html converstion
does anyone know know of any functions i can use, to take a chinese character and the such, and convert them to i think it's html equivilants, where you turn a chinese cahracter to &45678; or such. Language isn't really an issue with the exception of perl.... my current method involves pasting it in frontpage and then removing the charset and it does it for me =( it'd be sweet to automate this...i'm currently using asp, vb.net to do most of the stuff so if you know it in that language it'd be preferred....if not, hey, i'll take the advice... worse case senario, anyone know an algorithm to do this?
Last edited by unatratnag; August 20th, 2003 at 10:24 PM.
August 21st, 2003, 12:35 AM
IIRC, the HTML equivalent of a character is simply the unicode value converted to hexadecimal (with an & sign in front and a ; at the end, of course). So, all you need to do is convert each char to its unicode value and then convert that value to a hex string. My VB is a little rusty, but I believe AscW() and Hex() are probably what you need for this.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo