Changeset 1223
- Timestamp:
- 2000-06-21T10:24:15+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/unicode.pm
r537 r1223 33 33 34 34 35 # ascii2unicode takes a (extended) ascii string and36 # returns a unicode array.35 # ascii2unicode takes an (extended) ascii string (ISO-8859-1) 36 # and returns a unicode array. 37 37 sub ascii2unicode { 38 38 my ($in) = @_; … … 49 49 } 50 50 51 # arabic2unicode takes an 8 bit Arabic string (ISO-8859-6) 52 # and returns a unicode array 53 sub arabic2unicode { 54 my ($in) = @_; 55 my $out = []; 56 57 my $i = 0; 58 my $len = length($in); 59 while ($i < $len) { 60 my $c = ord(substr ($in, $i, 1)); 61 $c += (1567-191) if ($c >= 0x80); 62 push (@$out, $c); 63 $i++; 64 } 65 66 return $out; 67 } 51 68 52 69 # ascii2utf8 takes a (extended) ascii string and
Note:
See TracChangeset
for help on using the changeset viewer.