Perl Monk, Perl Meditation | |
PerlMonks |
Perl Encoding/Decoding Doubt: From a Noviceby ppremkumar (Novice) |
on Jul 04, 2013 at 11:00 UTC ( [id://1042435]=perlquestion: print w/replies, xml ) | Need Help?? |
ppremkumar has asked for the wisdom of the Perl Monks concerning the following question: Hi, Team I am at loss in terms of understanding the encoding process required in Perl with regard to writing results to the command prompt or to a file. In the below code, the first portion outputs just fine. In portion 2, however, when I added an em dash or the set of characters "ĀǎỠĨǒAder," the output is junk. (Yes, I want to print out ĀǎỠĨǒAder as is.)
Please help me understand what I am doing wrong. What I am really trying to do is read a Microsoft Word file that has special characters and store that data into a text file. Thanks, Prem UPDATE: I have found a solution to my problem: http://www.lemoda.net/perl/win32-ole-utf8/cp-utf8-ole.html I had to set the Win32 component to CP_UTF8 and set the code page of Win32::OLE to CP_UTF8. Now, even if my Microsoft Word files have special characters such as "Aderñŋšžľŀīửừứ," I could read each line of the Word file and save it in a text file without loss of characters. I thank each of you for your help and time. Greatly appreciated
Back to
Seekers of Perl Wisdom
|
|