From: SourceForge.net <no...@so...> - 2006-07-23 06:11:59
|
Bugs item #1487161, was opened at 2006-05-12 09:28 Message generated for change (Comment added) made by lkneschke You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=554338&aid=1487161&group_id=78745 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: felamimail Group: 1.2 final, no more RC1-8 please !!! Status: Open Resolution: None Priority: 5 Submitted By: Adi Kriegisch (akriegisch) Assigned to: Lars Kneschke (lkneschke) Summary: felamimail <> UTF-8 <> Postgres trouble Initial Comment: I have troubles with the encoding of emails that go to the mail cache table: whenever there is a german umlaut in the subject or a chinese spammer writing to me I cannot open the mailbox with the following postgres error: ------------------- While initializing Mailbox: Database error: Invalid SQL: INSERT INTO egw_felamimail_cache (fmail_date,fmail_subject,fmail_sender_name,fmail_sender_address,fmail_to_name,fmail_to_address,fmail_size,fmail_attachments,fmail_accountid,fmail_hostname,fmail_foldername,fmail_accountname,fmail_uid) VALUES (1144410583,'[SPAM?] [Openvpn-users] ope...@li...','�b�','llx...@pe...','','ope...@li...',5564,'false',6,'mail.kriegisch.at','TEST/Blah','adi',3567) pgsql Error: -1 (ERROR: invalid UTF-8 byte sequence detected near byte 0xc0) File: /usr/share/egroupware/felamimail/inc/class.socaching.inc.php Line: 66 Function: egw_db::insert / socaching::addToCache / bocaching::addToCache / bofelamimail::updateCache / bofelamimail::getHeaders / uifelamimail::viewMainScreen / ExecMethod(felamimail.uifelamimail.viewMainScreen) Session halted. ------------------- the error message stated: "invalid UTF-8 byte sequence"; so I went to class.socaching.inc.php and added utf8_encode to the following lines: ------------------- 'fmail_subject' => utf8_encode($_data['subject']), 'fmail_sender_name' => \ utf8_encode($_data['sender_name']), 'fmail_sender_address' => \ utf8_encode($_data['sender_address']), ------------------- now everything is fine for me. :-) But I am sure that this is not the right place and way to fix this: (1) not everyones default encoding is UTF-8 (2) this should be converted to $egw_info[``server''] [``charset''] (...or something similar; I just googled through dev-docs) (3) this should be converted when reading the values (in this case at least where "addToCache" is called from which is "updateCache" [class.bofelamimail.inc.php]...) ah... my setup: Debian/unstable with Debian packages from experimental postgres 8.1.3-4 (Debian/unstable) set to UTF-8 and php5 ---------------------------------------------------------------------- >Comment By: Lars Kneschke (lkneschke) Date: 2006-07-23 08:11 Message: Logged In: YES user_id=68218 I understand the problem. I will fix that while rewriting the cache backend anyway. I just want to let you know, that i'm aware of the problem. Thanks for the report. ---------------------------------------------------------------------- Comment By: orb_ter (orb_ter) Date: 2006-07-08 17:51 Message: Logged In: YES user_id=1160133 Same here with slovenian translations. Even instalation from scratch does not work with languages other than English. I'm also using PostgreSQL (8.0.3) on Gentoo using PHP 5.1.4 and Apache 2.0.58. Seems EGW is having lots of problems with UTF-8. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=554338&aid=1487161&group_id=78745 |