Fixing iconv(): Detected an illegal character in input string

Got the error in the title for the following code:

echo iconv('utf-8', 'Windows-1250', $xml_order);

The solution was adding ignore which tells iconv to ignore chars what he can’t convert.

echo iconv('utf-8', 'Windows-1250//ignore', $xml_order);
Advertisements

About Michal Zuber

Full stack developer, biker and rollerblader. Owner and developer at https://nevilleweb.sk/ Co-founded http://neville.sk/ Blog at https://michalzuber.wordpress.com/
This entry was posted in php and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s