"Fossies" - the Fresh Open Source Software Archive

Member "yudit-3.0.7/bin/simplemys.pl" (7 Jun 2020, 929 Bytes) of package /linux/misc/yudit-3.0.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "simplemys.pl" see the Fossies "Dox" file reference documentation.

    1 #!/usr/bin/perl
    2 # This script creates a mys source file from a simple
    3 # keymap file.
    4 
    5 print <<EOD;
    6 # YUDIT-NtoN  1.0
    7 NAME=Kmap for $ARGV[0]
    8 COMM=Made from UnicodeData.txt version 13.0.0
    9 COMM=Script: simplemys.pl
   10 COMM=GNU (C) 2020-12-12
   11 COMM=This map will produce UCS4 characters.
   12 TYPE=00000001
   13 SECTION=Section1
   14 ENCODE=00
   15 KEY_WIDTH=00
   16 VALUE_WIDTH=02
   17 KEY_LENGTH=00
   18 VALUE_LENGTH=00
   19 EOD
   20 
   21 while (<>) {
   22     chop;
   23     next if (/^#/);
   24     my @kvle = split (',', $_, 2);
   25     next unless ($#kvle == 1);
   26     my @vles = split (/ /, $kvle[0]);
   27     my $vle = "";
   28     for (@vles) {
   29        $vle .= sprintf (" %08X", hex($_));
   30     } 
   31     my $raw = $kvle[1];
   32     $raw =~ s/\([^\)]+\)//go;
   33     $raw =~ s/“//go;
   34     $raw =~ s/”//go;
   35     $raw =~ s/’/'/go;
   36     $raw =~ s/: /:/go;
   37     $raw =~ s/^ //go;
   38     $raw =~ s/ $//go;
   39     $raw =~ s/ /-/go;
   40     my @chars = split (//, $raw);
   41     my $key = join ("'", @chars);
   42     print "'$key ->$vle\n"; 
   43 }