luads / php-xbase

A simple parser for *.dbf files using PHP
MIT License
184 stars 84 forks source link

Create encoder: MbConvertEncodingEncoder #120

Closed honginho closed 1 year ago

honginho commented 1 year ago

Hi, In TableReader, IconvEncoder is used by default. When iconv("BIG5", "UTF-8", $string) fails, the program will interrupt immediately and return an error. However, by using mb_convert_encoding(), the program can still run normally even though some BIG5 strings fail to be converted into UTF-8.

To prevent errors when converting, I created the MbConvertEncodingEncoder as another encoding option, to use mb_convert_encoding() to convert strings.