Search Postgresql Archives

Re: \COPY to accept non UTF-8 chars in CHAR columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> "Thomas" == Thomas Munro <thomas.munro@xxxxxxxxx> writes:

 Thomas> Something like this approach might be useful for fixing the CSV file:

 Thomas> https://codereview.stackexchange.com/questions/185821/convert-a-mix-of-latin-1-and-utf-8-to-proper-utf-8

Or:

perl -MEncode -pe '
 use bytes;
 sub c { decode("UTF-8",shift,sub { decode("windows-1252", chr(shift)) }); }
 s/([\x80-\xFF]+)/encode("UTF-8",c($1))/eg' <infile >outfile

-- 
Andrew (irc:RhodiumToad)





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux