Convert pmwiki pages which show up as blank following the php5 change of default encoding to UTF-8.

Backup the pages

  • Find the non-ISO pages and move them to $page.bak

file * | grep -i non-ISO | cut -d: -f1 | xargs rename 's/$/.bak'

$[Get Code]1

  • Convert from WINDOWS-1252 first to ISO8859-1 with transliteration (so that smart-quotes are converted to ASCII quotes) then to UTF-8 (the new default encoding).

    for i in *.bak do   iconv -f WINDOWS-1252 -t ISO8859-1//TRANSLIT "$i" | iconv -f ISO8859-1 -t UTF-8 > $(basename "$i" .bak) done