Skip to content

Instantly share code, notes, and snippets.

@jyotty
Created August 2, 2013 23:24
Show Gist options
  • Save jyotty/6144252 to your computer and use it in GitHub Desktop.
Save jyotty/6144252 to your computer and use it in GitHub Desktop.
scan for non-utf8 data in a pgsql dump and print it
#!/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