String update
[squirrelmail.git] / po / charsetconvert.pl
CommitLineData
e3c6f613 1#! /usr/bin/perl
2
3# This script takes an Unicode character map as input and outputs
4# conversion code for SquirrelMail charset support.
5
6# This code is placed in the Public Domain. Written by Gustav Foseid,
7# gustavf@squirrelmail.org
8
9$min = 160;
10
11while (<>) {
12 chop;
13
14 unless (/^\#/) {
15
16 ($orig_text, $unicode_text, $dummy, $name) = split /\t/;
e50f5ac2 17
18 # oct does not only do what it's name suggest. If a string starts
e3c6f613 19 # with 0x it is interpreted as a hexadecimal value.
20 $orig = oct $orig_text;
21 $unicode = oct $unicode_text;
e50f5ac2 22
e3c6f613 23 if ($orig >= $min) {
a89c13f5 24 print " // $name\n";
25 printf (' $string = str_replace("\%o", "&#%d", $string);'."\n",
e50f5ac2 26 $orig, $unicode);
e3c6f613 27 }
e50f5ac2 28 }
e3c6f613 29}