|<B>--use-xs auto | always | neverB>||Override default (auto) behaviour of trying to use XS module and falling back to pure-Perl version if not available. Set to never to always use the Perl version or always to always use XS and die if not available.|
|<B>--versionB> (alias -v)||Display version number of underlying Encoding::FixLatin and XS modules.|
|<B>--helpB> (alias -?)||Display this documentation.|
This script was originally written to assist in converting a Postgres database from SQL-ASCII encoding to UNICODE UTF8 encoding. The following examples illustrate its use in that context.
If you have a SQL format dump file that you would normally restore by piping into psql, you can simply filter the dump file through this script:
fix_latin < dump_file | psql -d database
If you have a compressed dump file that you would normally restore using pg_restore, you can omit the -d option on pg_restore and pipe the resulting SQL through this script and into psql:
pg_restore -O dump_file | fix_latin | psql -d database
To take a look at non-ASCII lines in the dump file:
perl -ne /^COPY (\S+)/ and $t = $1; print "$t:$_" if /[^\x00-\x7F]/ dump_file
This script is implemented using the Encoding::FixLatin Perl module. For more details see the module documentation with the command:
In particular you should read the LIMITATIONS section to understand the circumstances under which data corruption might occur.
Copyright 2009-2014 Grant McLean <email@example.com>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||FIX_LATIN (1)||2014-05-22|