ID:               20809
 Comment by:       Xuefer at 21cn dot com
 Reported By:      flying at dom dot natm dot ru
 Status:           Closed
 Bug Type:         Feature/Change Request
 Operating System: All
 PHP Version:      4.3.0RC2
 New Comment:

it is said libxml2 does it this way(into numeric entities)
using iconv, means that it's possible, but i'm not sure

if it's possible, i guess it should be ok for php itself to implement
"//IGNORE"
simply scan for //IGNORE itself, then do copies whenever get
unconvertable error

it's badly needed to avoid truncate to the content only 1 char is
unconvertable.
many thanks


Previous Comments:
------------------------------------------------------------------------

[2002-12-04 23:43:32] [EMAIL PROTECTED]

You can achieve that by appending "//IGNORE" after the codeset name to
which the string is going to be converted.

For example:
<?php
  $bar = iconv("UTF-8", "KOI-8R//IGNORE", $foo);
?>

Note that this is not portable since most of the iconv implementations
don't support it. As far as I know, only glibc's iconv can handle
this.


------------------------------------------------------------------------

[2002-12-04 08:16:39] flying at dom dot natm dot ru

 It will be very useful to have support for -c and -s options available
for iconv command-line tool as optional arguments for iconv()
function.
 And also it will be specially useful for XML related code to have an
option to convert all unconvertable characters into numeric entities.

 Thank you all for your job!

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20809&edit=1

Reply via email to