My tool IO informations:
○ I am creating output text file (.txt) from VB.net as filename paraText.txt
○ paraText.txt
will be the input file for Perl
paraText.txt
contents :
Gerade innerhalb der kulturhistorischen Behandlung nimmt die Kultivierung der Zeit durch den Menschen und dessen Zeitbewusstsein einen zentralen Platz ein. Unter dem Stichwort der Zeitkultur strebt die kulturhistorische Forschung nach der anthropologischen Erkenntnissuche, welches Bewusstsein der Mensch von seiner Zeit hat, wie er mit seiner Zeit umgeht, und ob bzw. wie er sie gestaltet, sie mit Sinn auflädt und strukturiert. Dabei wird sinnfällig, dass sich jede Kultur nicht zuletzt durch ihren Umgang mit der Zeit und deren Gliederung definiert: Man unterscheidet zurückliegende und bevorstehende, teils willkürlich, teils durch gesellschaftliche bzw. naturgegebene Einflüsse eingetretene und noch zu erwartende Ereignisse. Einen Großteil dieser Ereigniskultur bildet – der — Komplex des Festlichen.
Problem :
○ when creating output txt file from VB.net I get correct text as follows:
○ While reading that text at debugging stage in Perl I get the text like unformatted :
You can see the above picture that the first line is not encoded corrctly,
Note: I using the same .txt for both in and out but I can not read the text correctly while debugging in perl 5.16.3 using Komodo edit 8.5, notepad++ to see the text
I Tried :
○ I write the text file from vb.net using UTF8 encoding,
System.Text.Encoding.UTF8
○ I also use UTF8 encoding in Perl using the following ways:
use Encode; use utf8; use open IO => ':utf8'; use Encoding::FixLatin qw(fix_latin);; binmode STDOUT, ":utf8"; binmode STDERR, ":utf8"; binmode STDIN, ":utf8";
My code Sample :
#!/usr/bin/perl -w
use strict;
use Cwd;
use HTML::Entities;
use HTML::Entities::Numbered;
use HTML::Strip;
use Encode;
use utf8;
use open IO => ':utf8';
use Encoding::FixLatin qw(fix_latin);;
binmode STDOUT, ":utf8";
binmode STDERR, ":utf8";
binmode STDIN, ":utf8";
my $indPara = getcwd()."/paraText.txt";
open(INDPARA, $indPara) || die "Indesign paraText not found on location!";
my $indesignPara = <INDPARA>;
$indesignPara = fix_latin($indesignPara);
print decode_entities($indesignPara);
close INDPARA;
# I am getting value for $indesignPara as unformatted text like shown in above incorrect image
please anybody please solve this
Thanks in advance
Vimal