Created
August 2, 2013 23:24
-
-
Save jyotty/6144252 to your computer and use it in GitHub Desktop.
scan for non-utf8 data in a pgsql dump and print it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Encode; | |
while (<>) { | |
print "\n$_" if /^COPY/; | |
eval { decode("UTF-8", $_, Encode::FB_CROAK) }; | |
print if $@; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment