summaryrefslogtreecommitdiff
path: root/perl2python.pl
diff options
context:
space:
mode:
authorTomaz Solc <avian@toybox.zemanta.com>2008-09-05 16:54:55 +0200
committerTomaz Solc <avian@toybox.zemanta.com>2008-09-05 16:54:55 +0200
commitf40f751b943f99a3162044d1a89f15b0fccaacd9 (patch)
treecaf474bd40e38708e2025b5b56512975d0363b5f /perl2python.pl
parentb2cedd05e3ce012098c23fbb263dc382ac45a302 (diff)
downloadunidecode-f40f751b943f99a3162044d1a89f15b0fccaacd9.tar.gz
Added comments showing codepoints
Diffstat (limited to 'perl2python.pl')
-rw-r--r--perl2python.pl13
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";