.
D 2003-11-11T15:39:30
J icomment Logged\sIn:\sYES\s\nuser_id=32170\n\nJeff,\swhat\sdo\syou\smean\sby\s'the\scorrect\soptions\swill\shandle\sit\sright'?\s\sI\s\nunderstand\snow\sthat\sI\swas\sexpecting\stoo\smuch\sfrom\shttp::geturl,\sbut\s\nnow\sit's\snot\sclear\show\sto\sget\swhat\sI\swant.\n\nIn\sthe\sabove\sexample,\n\nupvar\s#0\s$token\sstate\nputs\s$state(charset)\n\ngives\siso8859-1\s(the\sdefault)\swhich\sI\ssuppose\sI\smust\signore.\sHowever,\s\nI\salso\ssuppose\sit\smeans\sthe\stext\shas\sbeen\sread\sas\siso8859-1\s(which\s\ncould\ssurely\scause\ssome\sirretrievable\sloss,\sat\sleast\swhere\sthe\strue\s\nencoding\sis\ssomething\smore\scomplex\sthan\sutf-8).\n\nAnyway,\sI\ssee\sthree\sapproaches:\n\n(i)\stake\sthe\sreturned\stext,\sscan\sit\sfor\s<head><meta>\setc,\sextra\sthe\s\ncharset\sand\sconvert\sit\s(but\sfrom\swhat?\s--\sthe\sinformation\sin\s$contents\s\nis\sutf-8\swhich\shas\sbeen\sread\sas\siso8859-1!!)\n\n(ii)\salways\suse\s-binary\s1\swith\shttp::geturl\sand\sthen\smanually\sexamine\s\nboth\sthe\sheaders\sand\s(when\sthose\sheaders\sindicate\sa\stext\sfile)\sconvert\s\nthe\stext\sas\sappropriate\n\n(iii)\suse\sa\snormal\shttp::geturl,\sbut\swith\sa\scallback\swhich\slooks\sfor\s<\nhead><meta>\sand\scharset\stags\sin\sthe\scase\swhere\sthe\sinfo\sis\stextual,\s\nand\sin\sthat\scase\sadjusts\sthe\sencoding\sof\sthe\schannel\son\sthe\sfly\s\n(presumably\swould\sneed\sto\sadjust\sthe\sencoding\sof\sthe\sboth\sthe\sinput\s\nsocket\sand\sthe\soutput\schannel).\n\nAny\sadvice\son\show\sthis\sshould\swork?\s\n\nWhat\smost\sconcerns\sme\sis\sthe\saspect\sof\sinformation\sloss\sin\s(i)\sif\sthe\s\noriginal\stext\sis\sin\san\sencoding\swhich\sgets\smunged\sif\sits\sbytes\sare\s\ninterpreted\sas\siso8859-1.\n\n\n
J login vincentdarley
J mimetype text/plain
J status Open
J username vincentdarley
K 839289ffffffffffffffffffffffffffffffffff
U vincentdarley
Z 496054b3e30941b260a923f193e1b280