Search

Below is a PHP function that reads UTF-8 encoded text and spits out entity-encoded text suitable for use in webpages (with the proper character encoding set, of course). I know that 99.6% of won’t have any use for this whatsoever, but since I couldn’t find an example of this on the Internet and had to make my own, I thought it would be nice to post it.

function html_encode_utf8($s) {
	$len = strlen($s);
	$x = 0;
	while ($x

It was tested parsing the CEDICT Chinese dictionary, but I’ve not done much else with it, so there may still be bugs. If you find any, please drop and line and I’ll get them fixed.

6 Responses to “Decoding UTF-8”

    [comment not deleted, just moved where it should have been:

    http://wantingseed.com/weblog/2003/05/13/bigger_on_paper.php

    Just try to stay on-topic folks - _John_]

    Oh, it saved some work at least for me. Thanks a lot.

    im interested in being a videogame tester who would i contact for information on that

    is this encoded with UTF-8 … please email me

    M4$L#!!0““(`%T[="_]‘1M
    M4\MNVT`0NQOP/TSNM@PT0!/X4N16`RE0%.GC.I9&TE;2CKH/J_K[A#I-&[;E`-H%'(EY@G[/(-I',=GI;XN"H49?''YXT#LE]BNU.HZP5″MF91^YE0-D&H2C5CAL\T&P:#/’A*L[UX,;U8+`"X3I)0S^RJX=Q+3-28)@@+IK:
    MEAD@AQRM7DY)ICG%BK[:(,\=L$C>20*EUCR/8BP'&'H+.OT5:+`V>,*NK$%9
    MZQ1X"1WJOBZ#_8HQ+`3?K%(U5QCL6/"MDHTQPV&UT5-]::JP0H2MZ4>3UR?F,
    M[>18,L’”..I2K’.,BP8TF^`/%.?TGP^G99EJ29MCC^K6JL\G%H78CJQC[CGU=S/V_M2KEN

    i would like to be a video game tester but i live in a small town in arkansas where would i go to try to get a job as a tester

    i am 23 and would like to have information on where to go to become a beta tester for video games from home. i have four systems that i can use for the job. please send an e-mail. thanks.