note 18266 added to function.utf8-decode

From: Date: Wed, 16 Jan 2002 16:49:47 +0000
Subject: note 18266 added to function.utf8-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-24919@lists.php.net to get a copy of this message
Ok I couldn't work it out in php. So I used Perl instead. You need to install the following modules in your Perl distribution.. Unicode::Map Unicode::String At the top of your perl script put this.. ############################################# #!/usr/bin/perl use Unicode::Map; use Unicode::String qw(utf8 utf16); $us = Unicode::String->new(); $map = Unicode::Map->new("ISO-8859-9"); ############################################# Then when you want to decode a string from dmoz (utf8) into normal text do this.. ############################################# # Deal with unicode mapping $us->utf8($my_string); $my_new_string = $map->to8($us->utf16()); ############################################# Also.. If you want to put it into mySQL then you also need to install the DBI:mysql module. And then use the folowing code at the top of the script.. ############################################# use DBI; $dbh = DBI->connect('DBI:mysql:your_db_name', 'your_mysql_user_name', 'your_mysql_user_password'); ############################################# Then use this for the insert.. ############################################# # The insert statement $dbh->do("INSERT INTO your_table VALUES ('$field1','$field2','$etc')"); ############################################# -- http://www.php.net/manual/en/function.utf8-decode.php http://master.php.net/manage/user-notes.php?action=edit+18266 http://master.php.net/manage/user-notes.php?action=delete+18266 http://master.php.net/manage/user-notes.php?action=reject+18266

« previous php.notes (#24919) next »