Skip to content

invalid byte sequence in UTF 8 (ArgumentError) with wordmove init

Fabrizio Monti edited this page Apr 9, 2014 · 2 revisions

Cause

Some localized WordPress versions (like Italian and German one, for instance) have the wp-config-sample.php encoded in iso-8859-1 (latin1) instead of UTF-8 as the English one. Usually everyone copies wp-config-sample.php to wp-config.php, so both of them have the same encoding.

This error occurs because wordmove expects a wp-config.php file encoded in UTF-8.

We cannot assume a single right encoding for every localized wp-config.php file.

Solution

You should manually change your wp-config.php encoding from its current one to UTF-8.

In *nix environment and with wp-config.php encoded in iso-8859-1 these bash commands could save your day:

iconv -f ISO-8859-1 -t UTF-8 wp-config.php > wp-config.utf8.php
rm wp-config.php
mv wp-config.utf8.php wp-config.php

Please, change the iconv's -f argument accordingly if your wp-config.php is not encoded in iso-8859-1

Now wordmove init should work!