Hi group,

 

Opening a file for output is fine. I've also moved the binmode immediately 
after open, outside the loop. But, the error still shows. Now, here are the 
sample files and my command would be:

 

> perl number_sent.pl Sample_Eng.txt Sample_Hin.txt Sample_out.txt

 

File: Sample_Eng.txt

The time is ripe for a second SRC.

Most of this new-found resistance has begun after September 7 when the equity 
sale in oil companies was put off for three months.

The 20-year-old has just signed Jaal-The Trap with the balding Sunny Deol.

The elderly climber was elated on becoming the oldest man to conquer the peak.

Which means control over the press through the new owner-just about covered the 
principal.

Kashmir, as with many Pakistani soldiers and policy makers, has been his blind 
spot.

Don't knock it.

Anomaly has been noticed in supplying of Natural Gas to different industries in 
the North-East.

A former biochemist, figured out the art of running a successful business after 
a series of bad experiences with Just Desserts and Under the Over in Mumbai and 
Kottiyum in Bangalore.

The police then ruled out facilitating any meeting with Kalra since he is on 
bail.

 

File: Sample_Hin.txt

दूसरे राज्य पुनर्गठन आयोग के गठन का यही सही वक्त है।

अभी सामने आया यह ज्यादातर विरोध ७ सितंबर के बाद शुरू हुआ, जब तेल कंपनियों की 
इक्विटी बिक्री तीन महीने के लिए स्थगित कर दी गई।

कुल २० साल की इस बाला ने हाल ही में सनी देओल के साथ जाल-द ट्रैप फिल्म साइन की 
है।

वे इस शिखर पर पहुँचने वाले सबसे बुजुर्ग पर्वतारोही हैं।

जिसका मतलब यह है कि नए मालिक के जरिए प्रेस पर स्वेन का ही नियंत्रण रहेगा।

जहां तक कश्मीर का सवाल है, पाकिस्तान के दूसरे सैनिक तानाशाहों और नीति नियंताओं 
की तरह यह उनके लिए उलझन भरा मामला है।

इसे खारिज मत कीजिए।

पूर्वोत्तर में विभिन्न उद्योगों को प्राकृतिक गैस की आपूर्ति में असमानता देखी गई 
है।

पूर्व बायोकेमिस्ट मुंबई में जस्ट डेजर्ट्स तथा अंडर द ओवर और बंगलूर में कोट्टियम 
के बुरे अनुभवों के बाद व्यवसाय चलाने का गुर सीख गए हैं।

पुलिस ने कालरा से बटोही की मुलाकात भी नहीं करवाई क्योंकि वह जमानत पर है।

 

File: Sample_out.txt

1. ÿþT h e   t i m e   i s   r i p e   f o r   a   s e c o n d   S R C . 

 

ÿþ&      B          8          0          G            0        >              
     M         /             *         A          (           0          M      
                          (                    /           K                    
        G                               (                    >            /   
      9            @           8        9          @           5               
  M         $            9        H          d          

 

 

 

2.  M o s t   o f   t h i s   n e w - f o u n d   r e s i s t a n c e   h a s   
b e g u n   a f t e r   S e p t e m b e r   7   w h e n   t h e   e q u i t y   
s a l e   i n   o i l   c o m p a n i e s   w a s   p u t   o f f   f o r   t h 
r e e   m o n t h s . 

 

         -           @           8        >          .           (           G  
                 /           >            /         9                   M      
   /            >          &          >          $          0            5      
  ?          0          K          '             m         8        ?          
$          [1]            ,           0                   G            ,       
  >          &            6        A          0          B            9        
A                   ,            ,             $        G          2           
        [1]         *           (           ?          /           K          
[1]                  @                                M         5          ?  
        ­            @           ,         ?                   M         0     
     @           $        @         (              .         9          @       
  (           G                   G            2        ?                     
8        M         %                  ?            $                   0       
     &        @                           d          

 

And it goes on for 10 sentences. The sample files were created in Windows in 
Unicode (both English & Hindi) and I am able to open then in notepad and 
wordpad. But, the output as you see is garbage and somehow it misses the utf8. 
This apart, a blank space is added for every character in both English and 
Hindi.

 

Baskaran

 

Reply via email to