#1
  1. No Profile Picture
    Average Intelligence
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2003
    Location
    Ohio/Chicago
    Posts
    678
    Rep Power
    12

    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 09:24 PM.
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,616
    Rep Power
    4247
    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.

    HTH
    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

IMN logo majestic logo threadwatch logo seochat tools logo