Cannot write Greek newsletters

General talk about translations & I18n (Internationalization)

Cannot write Greek newsletters

Postby rippergr » 8:35am, Mon 11 May, 2009

Hello all
I have a problem with Greek Characters in phplist
When I write certain characters in Greek language the email is look like this

Subject ????
Content: ????Σερ???? ???

I saw that several people have the same problem but nobody gives the solution.
I change in 4-5 files the UTF-8 encoding to windows-1253 and in iso-8859-7 but I have the same result
I am sure that there is a solution to this problem because I receive newsletter emails from people in Greece that are using phplist.
rippergr
phpList newbie
 
Posts: 4
Joined: 8:29am, Mon 11 May, 2009

Re: Cannot write Greek newsletters

Postby H2B2 » 10:08pm, Mon 11 May, 2009

The charset used for the admin pages, and therefore also for all the input fields, including those related to messages, is determined by the $strCharSet variable found in your language file. The current $strCharSet for greek.inc is iso-8859-7, and not UTF-8.

Unfortunately some time ago developers made the decision to (temporarily?) hardcode UTF-8 in phpList. This of course results in trouble when non-ascii characters, like greek, are used with a $strCharSet setting other than UTF-8. Or, if your database is not encoded in UTF-8.

I think you will need to check that your whole system is pointing in the same direction with regard to charset encoding, i.e., make sure you use the same encoding everywhere in your phlist system, including the database and database connection.


This is what works for me. Though I'm using it for Spanish, it should also work for Greek:

phpList configuration
1. Configuration page:
- Charset for HTML messages: UTF-8
- Charset for Text messages: UTF-8

2. config.php
- $language_module = "spanish.inc"; # with $strCharSet = 'utf-8'; (Important: all text strings with special characters should be re-encoded to UTF-8. I believe Notepad++ has an option for that).
- define("HTMLEMAIL_ENCODING","quoted-printable");
- define("TEXTEMAIL_ENCODING",'7bit');

Note: After re-encoding your .inc language file: logout > login > delete and re-enter all data with special characters on the 'Configuration Page' and 'Edit subscribe page'. This will ensure the data is saved in the database with the correct UTF-8 encoding.

Database encoding:
character_set_client: utf8
character_set_connection: utf8
character_set_database: utf8
character_set_results: utf8
character_set_server: latin1
character_set_system: utf8
You can find out what your current database settings are by using this query in phpMyAdmin:
SHOW VARIABLES LIKE 'character_set_%'

PHP charset environment setting
HTTP_ACCEPT_CHARSET ISO-8859-1, utf-8; q=0.7, *; q=0.7
See also http://www.your_domain.com/lists/admin/?page=info

Server info
phplist 2.10.9
Linux/Apache
PHP 5.2.3
MySQL 4.1.12 - with database encoding set to: utf8_unicode_ci

I haven't yet tested it thoroughly with v2.10.10, but I don't think the code changes are very big, so I don't expect too much trouble, if any.

For more info, please see http://mantis.phplist.com/view.php?id=1644
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: Cannot write Greek newsletters

Postby rippergr » 6:50am, Tue 12 May, 2009

Thanks for the reply

I Don't know how to check
phpList configuration
1. Configuration page:
- Charset for HTML messages: UTF-8
- Charset for Text messages: UTF-8

config.php is exactly as you describe it besides the $language_module (I use greek.inc)

Also in my database I have character_set_database latin1
and in HTTP_ACCEPT_CHARSET I have ISO-8859-7, utf-8; q=0.7, *; q=0.7

Can you help me to change those ?
rippergr
phpList newbie
 
Posts: 4
Joined: 8:29am, Mon 11 May, 2009

Re: Cannot write Greek newsletters

Postby H2B2 » 5:43am, Wed 13 May, 2009

rippergr wrote:I Don't know how to check
phpList configuration
1. Configuration page:
- Charset for HTML messages: UTF-8
- Charset for Text messages: UTF-8
The admin module's configuration page is found at lists/admin/?page=configure
Somewhere towards the bottom of the page you should find the above Charset settings.

rippergr wrote:Also in my database I have character_set_database latin1

I'll assume the other database settings are already set to utf8, and that character_set_database is the only remaining one. You can use the following query in phpMyAdmin:
Code: Select all
ALTER DATABASE <db_name> DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

In order to check your database encoding settings afterwards:
Code: Select all
SHOW VARIABLES LIKE 'character_set_%'

NOTE: If your database already contains important data, then make a backup first.

rippergr wrote:and in HTTP_ACCEPT_CHARSET I have ISO-8859-7, utf-8; q=0.7, *; q=0.7
I don't think you need to change this, since utf-8 is already included.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Re: Cannot write Greek newsletters

Postby rippergr » 9:12am, Fri 15 May, 2009

Thanks I'll try it
rippergr
phpList newbie
 
Posts: 4
Joined: 8:29am, Mon 11 May, 2009

Re: Cannot write Greek newsletters

Postby rupertj » 11:16pm, Fri 17 May, 2013

Hello, I had the same problem thank you for the answers.
rupertj
phpList newbie
 
Posts: 2
Joined: 11:13pm, Fri 17 May, 2013

Re: Cannot write Greek newsletters

Postby rupertj » 11:21pm, Fri 17 May, 2013

Great topic! I looked a while on the internet for an answer.
rupertj
phpList newbie
 
Posts: 2
Joined: 11:13pm, Fri 17 May, 2013


Return to Translators & Internationalization

Who is online

Users browsing this forum: No registered users and 2 guests