[GTALUG] a solved problem unsolved itself: WordPress, MySQL, UTF-8

Seneca Cunningham tentra at gmail.com
Thu Dec 2 10:31:43 EST 2021


It is fixable.  I’ve dealt with similar transformation issues in the past (with a rather different cause).  You can’t use iconv to do the conversion of what the web server outputs, as there are a few bytes that show up that aren’t considered to be valid cp1252 code points.  We’ll see if the bit of Perl I’ve attached makes it through; it works on the page content I paste in, even not mangling the actually UTF-8 post_title.  It doesn’t include any of the DBD::MySQL bits that you would use to SELECT and UPDATE post_content FROM the wp_posts table (remember to take a full backup first).

> On Dec 2, 2021, at 09:11, Stewart C. Russell via talk <talk at gtalug.org> wrote:
> 
> On 2021-12-01 21:53, Jamon Camisso via talk wrote:
>> Do any of the casting suggestions on that link that I sent fix it?
> 
> I haven't had a chance to try them yet, but your note about the transformation being reversible gives me hope that it can be fixed.

Seneca

-------------- next part --------------
A non-text attachment was scrubbed...
Name: conv.pl
Type: text/x-perl-script
Size: 1767 bytes
Desc: not available
URL: <http://gtalug.org/pipermail/talk/attachments/20211202/6af74741/attachment.bin>
-------------- next part --------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1388 bytes
Desc: not available
URL: <http://gtalug.org/pipermail/talk/attachments/20211202/6af74741/attachment-0001.bin>


More information about the talk mailing list