Forum OpenACS Q&A: Converting SQL_ASCII to UTF-8 in postgres

Request notifications

If you have an old postgres database that is still stored in SQL_ASCII and you want to move to one stored in UTF-8 (which is the standard for OpenACS), you can do the following:

- pg_dump -f your_db.dmp your_db
- iconv -f ISO8859-1 -t UTF-8 your_db.dmp > utf.dmp
- psql your_utf_db < utf.dmp

This assumes, that SQL_ASCII has been storing the content in ISO8859-1, which is a safe bet if you are in the US or western Europe. But don't nail me on that, if it does not work, try different source character sets (manual for iconv:

Posted by luba novikova on