http://www.perlmonks.org?node_id=652886


in reply to Re^2: Convert Windows-1252 Characters to Java Unicode Notation
in thread Convert Windows-1252 Characters to Java Unicode Notation

You may be better off with a hard coded translation table, for performance.

my %w1252_to_java = map { chr($_) => sprintf("\\u%04x", decode "Windows-1252", chr) } 0x80 .. 0xff; ... $md->{$column} =~ s/([\x80-\xff])/$w1252_to_java{$1}/g;