Leser: 22
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/perl use strict; use warnings; use Encode qw/from_to/; open my $input, "<:encoding(UTF-16LE)", ".input.txt" or die "kann das Lexikon nicht öffnen: $!"; from_to($input,"UTF16LE","UTF8"); print "$input\n";
QuoteThe data in $octets must be encoded as octets and not as characters in Perl's internal format.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/perl use strict; use warnings; use Encode; open my $input, "<", "input.txt" or die "kann das Lexikon nicht öffnen: $!"; my($raw_octets,$perl_scalar,$utf8_octets); while($raw_octets = <$input>){ $perl_scalar = decode("UTF-16LE", $raw_octets); $utf8_octets = encode("utf8", $perl_scalar); print $utf8_octets; } close($input);
㘀 崀䌀伀䐀䔀㨀㐀嬀㐀㌀ 崀䌀伀䐀䔀㨀 䰀愀猀琀琀爀愀攀最攀爀 嬀戀攀愀爀戀攀椀琀攀琀崀儀唀䄀㨀 嬀䌀匀㌀崀䌀伀䐀䔀㨀 嬀䴀䄀㠀崀䌀伀䐀䔀㨀㐀笀匀紀 嬀㘀 崀䌀伀䐀䔀㨀㔀嬀㔀 崀䌀伀䐀䔀㨀 嬀唀渀琀攀爀琀攀椀氀崀䈀䔀娀㨀 嬀䌀匀㌀崀䌀伀䐀䔀㨀 一䌀㜀㐀笀匀紀嬀嘀 崀䌀伀䐀䔀㨀 嬀 㠀崀倀䄀䌀㨀 䐀爀甀挀欀攀爀最攀栀愀攀甀猀攀 䴀愀爀挀栀攀猀椀笀匀紀嬀嘀 崀䌀伀䐀䔀㨀 嬀 㠀崀倀䄀䌀㨀㈀ 嬀匀愀攀甀氀攀崀䈀䔀娀㨀 䴀愀爀挀栀攀猀椀笀匀紀嬀嘀 崀䌀伀䐀䔀㨀 嬀 㠀崀倀䄀䌀㨀㐀 嬀匀愀攀甀氀攀崀䈀䔀娀㨀 䴀愀爀挀栀攀猀椀笀匀紀嬀圀 崀䌀伀䐀䔀㨀 ㈀ 㠀㔀 䰀愀猀琀琀爀最攀爀 嬀䌀愀爀爀椀攀爀崀吀夀倀㨀笀匀紀嬀圀 崀䌀伀䐀䔀㨀 ㈀ 㠀㘀 嬀唀渀琀攀爀琀攀椀氀崀䈀䔀娀㨀 戀漀琀琀漀渀 嬀瀀愀爀琀崀䘀刀䴀㨀笀匀紀嬀圀 崀䌀伀䐀䔀㨀 ㈀ 㠀㜀 嬀唀渀琀攀爀琀攀椀氀崀䈀䔀娀㨀 一䌀㜀㐀 戀漀琀琀漀渀 嬀瀀愀爀琀崀䘀刀䴀㨀笀匀紀嬀圀 崀䌀伀䐀䔀㨀 ㈀ ㈀㌀ 䐀爀甀挀欀攀爀最攀栀愀攀甀猀攀 䴀愀爀挀栀攀猀椀笀匀紀嬀圀 崀䌀伀䐀䔀㨀 嬀㈀ ㈀㐀崀䌀伀䐀䔀㨀 嬀匀愀攀甀氀攀崀䈀䔀娀㨀 䴀愀爀挀栀攀猀椀笀匀紀
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
([BLECH]FRM: 1,5 [NIROSTA]MAT:)
[4X20X32]MASS: [NIROSTA]MAT:
[5Min]MASS:. Empfindlichk. [D=15mm]MASS:
[M5x8]MASS: [DIN 912]NORM: [Niro]FRM:
[DIN 912]NORM: [M4x10]MASS:
BLINDSCHRAUBE [M8X11]MASS:
FUSSCHRAUBE, [KPL.]QUA: [M 24X75]MASS:
[STELLSCHRAUBE]BEZ:, [KPL.]QUA:
[STELLSCHRAUBE]BEZ:, [NIROSTA]MAT:
[STELLSCHRAUBE]BEZ: [M 16X100]MASS: [KPL.]QUA: ([NIRO]FRM:)
[HALTER]BEZ:
[DRUCKSTUECK]BEZ:
[UNTERTEIL]BEZ:
[Tellerfeder]BEZ:
NETZZULEITUNG,
LAUFROLLENTRAEGER
[BUCHSE]BEZ:
[LAUFROLLE]BEZ: [MIT KUGELLAGER]ATTRQUA:
[SCHRAUBE]BEZ:
[WELLE]BEZ:
[WELLE]BEZ: [MIT HUELSE]ATTRQUA:
[WELLE]BEZ:
[HUELSE]BEZ:
ANSCHLAGSTIFT
SPERRSCHEIBE
1 2 3 4 5 6
while($raw_octets = <$input>){ chomp $raw_octets; $perl_scalar = decode("UTF-16LE", $raw_octets); $utf8_octets = encode("utf8", $perl_scalar); print $output $utf8_octets . "\n"; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl use strict; use warnings; use Encode; my $from = $ARGV[0]; my $to = $ARGV[1]; my $in_file = $ARGV[2]; my $out_file = $ARGV[3]; open my $input, "<:encoding($from)", $in_file or die "$!"; open my $output, ">:encoding($to)", $out_file or die "$!"; while(<$input>){ print $output $_; } close($input); close($output);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/usr/bin/perl use strict; use warnings; use Encode; my $from = $ARGV[0]; my $to = $ARGV[1]; my $in_file = $ARGV[2]; my $out_file = $ARGV[3]; open my $input, "<", $in_file or die "$!"; open my $output, ">", $out_file or die "$!"; local $/ = undef; my($raw_octets,$perl_scalar,$utf8_octets); while($raw_octets = <$input>){ $perl_scalar = decode($from, $raw_octets); $utf8_octets = encode($to, $perl_scalar); print $output $utf8_octets; } close($input); close($output);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/usr/bin/perl use strict; use warnings; use Encode qw(from_to); my $from = $ARGV[0]; my $to = $ARGV[1]; my $in_file = $ARGV[2]; my $out_file = $ARGV[3]; open my $input, "<", $in_file or die "$!"; open my $output, ">", $out_file or die "$!"; local $/ = undef; while(my $octets = <$input>){ from_to($octets,$from,$to); print $output $octets; } close($input); close($output);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl use strict; use warnings; use Encode; my $from = $ARGV[0]; my $to = $ARGV[1]; my $in_file = $ARGV[2]; my $out_file = $ARGV[3]; open my $input, "<:encoding($from)", $in_file or die "$!"; open my $output, ">:encoding($to)", $out_file or die "$!"; while(<$input>){ print $output $_; } close($input); close($output);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/usr/bin/perl use strict; use warnings; use Encode qw(from_to); my $from = $ARGV[0]; my $to = $ARGV[1]; my $in_file = $ARGV[2]; my $out_file = $ARGV[3]; open my $input, "<", $in_file or die "$!"; open my $output, ">", $out_file or die "$!"; if($from eq 'UTF-16LE'){ $/ = "\012\000"; } while(my $octets = <$input>){ from_to($octets,$from,$to); print $output $octets; } close($input); close($output);