Re: PHP4.0.6, php_iconv bugs
| From: | Piotr Pawlow | Date: | Fri, 10 Aug 2001 15:50:52 +0000 |
| Subject: | Re: PHP4.0.6, php_iconv bugs | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-62852@lists.php.net to get a copy of this message | ||
"Stig Sæther Bakken" <ssb@alltheweb.com> wrote:
> Did you test the same thing with another program using iconv?
I have tried iconv tool, which behaves quite nicely, because when it
encounters an illegal sequence it says "iconv: illegal input sequence
at position xxx", so you can correct your input string and try again.
Anyway, I found a better solution, read on.
> I've encountered the same problem in iconv when I tried to convert
> an ISO-8859-1 string containing "~" to Shift_JIS. Shift_JIS
> actually does not define the tilde character, so iconv bailed out
> and returned an empty string (the solution is using codepage 932
> instead when people ask for Shift_JIS. Bleh.)
Try adding //TRANSLIT to the output encoding
(eg."Shift_JIS//TRANSLIT"). Iconv will then try very hard to recode
your string, using transliterations where straight recoding is not
available, and question marks where no direct conversion nor
transliteration is available.
This information is gathered from various message boards and it works
for me. I am not sure, however, since which version of iconv this
feature is available. There is no single word about it in my iconv*
man pages. Unfortunately iconv home page,
http://clisp.cons.org/~haible/packages-libiconv.html,
seems to be
dead.
--
Regards,
Piotr Pawlow
mailto:pp@siedziba.pl