User Tools

Site Tools


psql_ascii_2_utf8

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
psql_ascii_2_utf8 [2014/10/20 14:44] sweitmannpsql_ascii_2_utf8 [2023/02/20 14:52] sweitmann
Line 5: Line 5:
 Then switch to the "postgres" account: Then switch to the "postgres" account:
      su postgres      su postgres
-Now create a dump of your SQL_ASCII database:+Now start by creating a dump of your SQL_ASCII database:
  
      pg_dump SQL_ASCII_database_name > SQL_ASCII_database_dump.sql      pg_dump SQL_ASCII_database_name > SQL_ASCII_database_dump.sql
Line 11: Line 11:
  
     file SQL_ASCII_database_dump.sql     file SQL_ASCII_database_dump.sql
-You should get the following output: +You should get the following output:    
-    +
     SQL_ASCII_database_dump.sql: ISO-8859 text     SQL_ASCII_database_dump.sql: ISO-8859 text
-Then you convert your ISO-8859 file to UTF8 by typing:+Then you convert your ISO-8859 or CP1250 file to UTF8 by typing:
  
     cat SQL_ASCII_database_dump.sql | recode iso-8859-1..u8 > UTF8_database_dump.sql     cat SQL_ASCII_database_dump.sql | recode iso-8859-1..u8 > UTF8_database_dump.sql
 +    
 +    iconv -f CP1250 -t UTF-8 -c <Non-ISO-extended-ASCII-FILE.sql >UTF8_database_dump.sql
 Check the result by typing: Check the result by typing:
  
     file UTF8_database_dump.sql     file UTF8_database_dump.sql
 +You should now get the following output: 
  
-You should now get the following output:  
     UTF8_database_dump.sql: UTF-8 Unicode text     UTF8_database_dump.sql: UTF-8 Unicode text
- 
 Now open the new UTF8_database_dump.sql file with your favourite editor and change the line: Now open the new UTF8_database_dump.sql file with your favourite editor and change the line:
     SET client_encoding = 'SQL_ASCII';     SET client_encoding = 'SQL_ASCII';
Line 36: Line 36:
        
    
- 
psql_ascii_2_utf8.txt · Last modified: 2023/02/20 14:52 by sweitmann