File: SOSI1.pm

package info (click to toggle)
libencode-hanextra-perl 0.23-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,292 kB
  • sloc: perl: 1,025; makefile: 3
file content (49 lines) | stat: -rw-r--r-- 815 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package Encode::TW::Unisys::SOSI1;

use strict;

use vars qw($VERSION);
$VERSION = '1.01';

use Encode ();

use base qw(Encode::Encoding);
__PACKAGE__->Define('unisys-sosi1');

sub needs_lines  { 1 }

sub perlio_ok { 
    return 0; # for the time being
}

sub decode
{
    my ($obj,$str,$chk) = @_;
    my $unisys = Encode::find_encoding('unisys');

    $str =~ s/\x2b([^\x2c]*)\x2c/' ' . $unisys->decode($1, $chk) . ' '/eg;
    return $str;
}

sub encode
{
    my ($obj,$str,$chk) = @_;
    my $unisys = Encode::find_encoding('unisys');

    $str =~ s/\x20?([^\x00-\x7f]+)\x20?/"\x2b" . $unisys->encode($1, $chk) . "\x2c"/eg;
    return $str;
}

1;
__END__


=head1 NAME

Encode::Unisys::SOSI1 - Internal module for unisys_sosi1 characters.

=head1 DESCRIPTION

See L<Encode::HanExtra> for more information.

=cut