Thanks again for your reply's. The addition of *:encoding(windows-1255)solved the problem.
So the problem was because Perl didn't recognize the right encoding? Thanks again Moshe * 2012/8/28 Meir Guttman <[email protected]> > Hi Moshe!**** > > First, thank you Dov for pointing us to this Win32::OLE blog.**** > > And Moshe, another thing that I learned the hard way: If your input is an > HTML file you scrap off the Internet, you better make sure what Encoding is > it. Don’t trust the HTML “encoding” tag. It is often wrong.**** > > Always open such files using the three-argument variety, AND (important!) > in the second argument include the encoding in addition to the > read/write/append/etc. symbol, as in:**** > > *open(my $fh, "<:encoding(windows-1255)", $filename) or die "$!\n";* > > And use the «*":encoding»* part, although eliminating it “works”. It goes > through an additional piece of code that verifies the correctness of the > encoding.**** > > I hope this helps…**** > > Meir**** > > ** ** > > ** ** > > *From:* [email protected] [mailto:[email protected]] *On > Behalf Of *Dov Levenglick > *Sent:* יום ג 28 אוגוסט 2012 10:18 > > *To:* Perl in Israel > *Subject:* Re: [Israel.pm] בעיה בקידוד**** > > ** ** > > The following link indicates that perhaps you have to change Win::OLE to > utf8: http://www.lemoda.net/perl/win32-ole-utf8/cp-utf8-ole.html > **** > > ** ** > > בברכה | Best Regards, **** > > דוב לוונגליק | Dov Levenglick **** > > > > **** > > 2012/8/28 moshe nahmias <[email protected]>**** > > טוב, דבר ראשון תודה על הניסיונות לעזור. > > יובל, הפיתרון שהצעת עזר לצמצם את הבעיה, כנראה ה-utf8 של לינוקס וה-utf8 של > פרל שונים או משהו כי כשאני עושה את ההצעה שלך כדי לוודא שזה utf8 זה לא > עובד (לא מקבל פלט במקומות הרלוונטים. > הענין הוא שאני צריך שזה יכתוב את המידע בצורה נכונה כך שאני לא יכול להתעלם > מכל מה שהוא לא utf8 אלא אני צריך להפוך אותו לכזה. מה גם שזה בוודאות utf8כי זה > עשה לי בעיות קודם כשהעברתי את הקובץ ללינוקס. > עשיתי את ההמרה עם iconv ואז יכולתי לראות את המידע בקובץ המקורי. > > מאיר, כנראה שכחתי לציין שזה לא משנה (לפחות כרגע, בתקוה בהמשך זה באמת > יעזור) אם אני משתמש ב-use utf8 או לא, התוצאות זהות, אני מניח שזה נובע מכך > שפרל לא מזהה את המידע בתור utf8 וכנראה לא מזהה את המקור (אחרת אני מניח > שזה היה עושה המרה או משהו, לא?). > > השאלה איך ממשיכים מפה? > > משה**** > > ** ** > > 2012/8/28 Meir Guttman <[email protected]>**** > > Dear Moshe,**** > > **** > > Put the following pragma at the start of your code:**** > > use utf8;**** > > This pragma tells Perl that the code itself contains Unicode characters in > strings, RE, etc. Unicode BTW ain’t simple. The standard itself is north of > 600 pages… Why isn’t that the default beats the Sh%^&t out of me, but it > is not. Probably some fears about backward compatibility.**** > > Meir**** > > **** > > *From**:* [email protected] [mailto:[email protected]] *On > Behalf Of** *moshe nahmias > *Sent**:* יום ג 28 אוגוסט 2012 01:36 > *To**:* Perl in Israel > *Subject**:* Re: [Israel.pm] בעיה בקידוד**** > > **** > > אוקי, הבנתי מה הגורם לבעיה אבל לא למה זה עושה את הבעיה... > המידע שלי מסודר במשתנים ומשום מה זה גורם לבעיה, כששמתי סתם מילה (לא משנה > אם בעברית או באנגלית) זה עבד כמו שצריך... > השאלה איך אני יכול לגרום לזה לעבוד עם משתנים? (אם זה אפשרי)**** > > **** > > 2012/8/27 Y L <[email protected]>**** > > אני עובד עם Spreadsheet::WriteExcel וצריך לוודא את התוכן לפני הוספה:**** > > _utf8_on($cell); > $cell = '' unless utf8::valid($cell);**** > > בגלל שהנתונים הגולמיים שלי קצת בעיתיים - מכילים הרבה זבל. > ממה שאני מבין במצב רגיל זה עובד בלי בעיות. > בגרסא מתקדמת יותר עברתי להשתמש ב Excel::Writer::XLSX > גם שם אני עושה אותו טריק. > מרוצה מאוד מהמודולים האלה.**** > > **** > > 2012/8/27 moshe nahmias <[email protected]>**** > > היי, > אני משתמש במודול spreadsheet::Write עבור פרויקט שאני עובד עליו (צריך > להעביר מידע מקובץ XML שיש לי לאקסל כדי שיהיה נוח למישהו אחר לקרוא את > המידע). > הצלחתי בהכל פרט לדבר קטן אך חשוב, המידע מוצג בג'יבריש... > השאלה איך אני גורם לזה להיות מוצג כמו שצריך, המידע כתוב בעברית (אני לוקח > אותו מה-XML ומעביר אותו תוך שימוש במודול לקובץ אקסל שאני יוצר. > משתמש ב-dwimperl גרסה 5.14.2 > > כשאני מעביר את המידע לקובץ טקסט הכל עובד כמו שצריך כך שאני חושד במודול או > באקסל אם זה מעביר בקידוד אחר (מכונת חלונות, אבדוק את זה גם בלינוקס היום). > > בתודה, משה**** > > **** > > ** ** > > _______________________________________________ > Perl mailing list > [email protected] > http://mail.perl.org.il/mailman/listinfo/perl >
_______________________________________________ Perl mailing list [email protected] http://mail.perl.org.il/mailman/listinfo/perl
