Tech /

Pm Wiki Fix Encoding





edit SideBar

Pm Wiki Fix Encoding

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'
  • 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
Recent Changes (All) | Edit SideBar Page last modified on 28 June 2013, at 04:41 PM UTC Edit Page | Page History
Powered by PmWiki