sza

חבר מתאריך 26.4.02
12357 הודעות, 22 פידבק |
22:13 23.05.13 |

|
1. אוקי, עכשיו מצאתי את הדבר המעניין הבא
בתגובה להודעה מספר 0
 |
ערכתי לאחרונה בתאריך 23.05.13 בשעה 22:17 בברכה, sza
ציטוט
Ok, found a solution to it. This goes for all of you who encounter a similar problem not necessarily with Hebrew, but with any other multibyte language: fgetcsv does not support multibyte. Hence, it will never read Hebrew. Step one was that I had to write the file with fwrite and read it with fread instead of using fputcsv and fgetcsv. Step two was to use mb_send_mail() function instead of the plain mail() function, and before calling it, setting the mb_language('he') and mb_internal_encoding('UTF-8'). Now it all works well. Cron sends the emails perfectly.
מתוך http://stackoverflow.com/questions/16089903/php-cron-script-read-from-from-csv-file-and-email-utf-8 וזו גם הסיבה שהצלחתי רק לכתוב ולא לקרוא, את הכתיבה לקובץ יצרתי בלולאה עם fwrite... אם הייתי יודע את זה לא הייתי בונה מלכתחילה את הפונקציה הזו על csv =\ -- צחי.
|
|
(ניהול: מחק תגובה) |
מכתב זה והנלווה אליו, על אחריות ועל דעת הכותב בלבד
|
| |