diff options
author | Tomaz Solc <avian@toybox.zemanta.com> | 2008-09-05 16:54:55 +0200 |
---|---|---|
committer | Tomaz Solc <avian@toybox.zemanta.com> | 2008-09-05 16:54:55 +0200 |
commit | f40f751b943f99a3162044d1a89f15b0fccaacd9 (patch) | |
tree | caf474bd40e38708e2025b5b56512975d0363b5f /perl2python.pl | |
parent | b2cedd05e3ce012098c23fbb263dc382ac45a302 (diff) | |
download | unidecode-f40f751b943f99a3162044d1a89f15b0fccaacd9.tar.gz |
Added comments showing codepoints
Diffstat (limited to 'perl2python.pl')
-rw-r--r-- | perl2python.pl | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/perl2python.pl b/perl2python.pl index d512a40..978ff00 100644 --- a/perl2python.pl +++ b/perl2python.pl @@ -28,16 +28,13 @@ for($n = 0; $n < 256; $n++) { next unless( $#{$Text::Unidecode::Char[$n]} >= 0 ); open(PYTHON, sprintf(">%s/x%02x.py", $output, $n)); - print PYTHON "data = ("; + print PYTHON "data = (\n"; - my $first = 1; + my $m = 0; for my $t (@{$Text::Unidecode::Char[$n]}) { - if( $first ) { - $first = 0; - } else { - print PYTHON ", "; - } - print PYTHON "'", &python_escape($t), "'"; + print PYTHON "'", &python_escape($t), "' # "; + printf PYTHON "0x%02x\n", $m; + $m++; } print PYTHON ")\n"; |