[PHP] French characters
Hi, I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description détaillée After the update:Pas de description détaillée When I read from the table I wrap the data in the following: // Stripslashes if (!get_magic_quotes_gpc()) { $value = stripslashes($value); } // Convert all applicable characters to HTML entities $value = htmlentities($value,ENT_COMPAT); When I update to the table, I wrap in the following: // Addslashes if (!(get_magic_quotes_gpc())) { $value = addslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = @mysql_real_escape_string($value); } I've tried playing with character sets to no avail. There mst be a solution, Thanks Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] French characters
What about browsers encoding? And also, does your html code has a header about character-encoding in french -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 3:58 PM To: php-general@lists.php.net Subject: [PHP] French characters Hi, I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description détaillée After the update:Pas de description détaillée When I read from the table I wrap the data in the following: // Stripslashes if (!get_magic_quotes_gpc()) { $value = stripslashes($value); } // Convert all applicable characters to HTML entities $value = htmlentities($value,ENT_COMPAT); When I update to the table, I wrap in the following: // Addslashes if (!(get_magic_quotes_gpc())) { $value = addslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = @mysql_real_escape_string($value); } I've tried playing with character sets to no avail. There mst be a solution, Thanks Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildiği belirtilen kişi/kişilere özeldir ve gizlidir. Size yanlışlıkla ulaşmışsa lütfen gönderen kisiyi bilgilendiriniz ve mesajı sisteminizden siliniz. Mesaj ve eklerinin içeriği ile ilgili olarak şirketimizin herhangi bir hukuki sorumluluğu bulunmamaktadır. Şirketimiz mesajın ve bilgilerinin size değişikliğe uğrayarak veya geç ulaşmasından, bütünlüğünün ve gizliliğinin korunamamasından, virüs içermesinden ve bilgisayar sisteminize verebileceği herhangi bir zarardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system.
Re: [PHP] French characters
I am using the following code: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:e2c046087e10d943811a0bd0a4e8316d1bd2e81...@ankara.anadolusigorta.pvt... What about browsers encoding? And also, does your html code has a header about character-encoding in french -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 3:58 PM To: php-general@lists.php.net Subject: [PHP] French characters Hi, I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description détaillée After the update:Pas de description détaillée When I read from the table I wrap the data in the following: // Stripslashes if (!get_magic_quotes_gpc()) { $value = stripslashes($value); } // Convert all applicable characters to HTML entities $value = htmlentities($value,ENT_COMPAT); When I update to the table, I wrap in the following: // Addslashes if (!(get_magic_quotes_gpc())) { $value = addslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = @mysql_real_escape_string($value); } I've tried playing with character sets to no avail. There mst be a solution, Thanks Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildiði belirtilen kiþi/kiþilere özeldir ve gizlidir. Size yanlýþlýkla ulaþmýþsa lütfen gönderen kisiyi bilgilendiriniz ve mesajý sisteminizden siliniz. Mesaj ve eklerinin içeriði ile ilgili olarak þirketimizin herhangi bir hukuki sorumluluðu bulunmamaktadýr. Þirketimiz mesajýn ve bilgilerinin size deðiþikliðe uðrayarak veya geç ulaþmasýndan, bütünlüðünün ve gizliliðinin korunamamasýndan, virüs içermesinden ve bilgisayar sisteminize verebileceði herhangi bir zarardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] French characters
You may use UTF-8 both in your code and database. It is used more commonly. (almost seems to become a encoding standart) -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 4:08 PM To: php-general@lists.php.net Subject: Re: [PHP] French characters I am using the following code: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:e2c046087e10d943811a0bd0a4e8316d1bd2e81...@ankara.anadolusigorta.pvt... What about browsers encoding? And also, does your html code has a header about character-encoding in french -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 3:58 PM To: php-general@lists.php.net Subject: [PHP] French characters Hi, I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description détaillée After the update:Pas de description détaillée When I read from the table I wrap the data in the following: // Stripslashes if (!get_magic_quotes_gpc()) { $value = stripslashes($value); } // Convert all applicable characters to HTML entities $value = htmlentities($value,ENT_COMPAT); When I update to the table, I wrap in the following: // Addslashes if (!(get_magic_quotes_gpc())) { $value = addslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = @mysql_real_escape_string($value); } I've tried playing with character sets to no avail. There mst be a solution, Thanks Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildiði belirtilen kiþi/kiþilere özeldir ve gizlidir. Size yanlýþlýkla ulaþmýþsa lütfen gönderen kisiyi bilgilendiriniz ve mesajý sisteminizden siliniz. Mesaj ve eklerinin içeriði ile ilgili olarak þirketimizin herhangi bir hukuki sorumluluðu bulunmamaktadýr. Þirketimiz mesajýn ve bilgilerinin size deðiþikliðe uðrayarak veya geç ulaþmasýndan, bütünlüðünün ve gizliliðinin korunamamasýndan, virüs içermesinden ve bilgisayar sisteminize verebileceði herhangi bir zarardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildigi belirtilen kisi/kisilere özeldir ve gizlidir. Size yanlislikla ulasmissa lütfen gönderen kisiyi bilgilendiriniz ve mesaji sisteminizden siliniz. Mesaj ve eklerinin içerigi ile ilgili olarak sirketimizin herhangi bir hukuki sorumlulugu bulunmamaktadir. Sirketimiz mesajin ve bilgilerinin size degisiklige ugrayarak veya geç ulasmasindan, bütünlügünün ve gizliliginin korunamamasindan, virüs içermesinden ve bilgisayar sisteminize verebilecegi herhangi bir zarardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system.
Re: [PHP] French characters
Thanks. For the database, there are many UTF8 collations. Is this the recommended one? UTF8_unicode-ci? - Original Message - From: Mert Oztekin To: 'Don' ; php-general@lists.php.net Sent: Monday, October 19, 2009 9:13 AM Subject: RE: [PHP] French characters You may use UTF-8 both in your code and database. It is used more commonly. (almost seems to become a encoding standart) -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 4:08 PM To: php-general@lists.php.net Subject: Re: [PHP] French characters I am using the following code: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:e2c046087e10d943811a0bd0a4e8316d1bd2e81...@ankara.anadolusigorta.pvt... What about browsers encoding? And also, does your html code has a header about character-encoding in french -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 3:58 PM To: php-general@lists.php.net Subject: [PHP] French characters Hi, I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description détaillée After the update:Pas de description détaillée When I read from the table I wrap the data in the following: // Stripslashes if (!get_magic_quotes_gpc()) { $value = stripslashes($value); } // Convert all applicable characters to HTML entities $value = htmlentities($value,ENT_COMPAT); When I update to the table, I wrap in the following: // Addslashes if (!(get_magic_quotes_gpc())) { $value = addslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = @mysql_real_escape_string($value); } I've tried playing with character sets to no avail. There mst be a solution, Thanks Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildiði belirtilen kiþi/kiþilere özeldir ve gizlidir. Size yanlýþlýkla ulaþmýþsa lütfen gönderen kisiyi bilgilendiriniz ve mesajý sisteminizden siliniz. Mesaj ve eklerinin içeriði ile ilgili olarak þirketimizin herhangi bir hukuki sorumluluðu bulunmamaktadýr. Þirketimiz mesajýn ve bilgilerinin size deðiþikliðe uðrayarak veya geç ulaþmasýndan, bütünlüðünün ve gizliliðinin korunamamasýndan, virüs içermesinden ve bilgisayar sisteminize verebileceði herhangi bir zarardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildigi belirtilen kisi/kisilere özeldir ve gizlidir. Size yanlislikla ulasmissa lütfen gönderen kisiyi bilgilendiriniz ve mesaji sisteminizden siliniz. Mesaj ve eklerinin içerigi ile ilgili olarak sirketimizin herhangi bir hukuki sorumlulugu bulunmamaktadir. Sirketimiz mesajin ve bilgilerinin size degisiklige ugrayarak veya geç ulasmasindan, bütünlügünün ve gizliliginin korunamamasindan, virüs içermesinden ve bilgisayar sisteminize verebilecegi herhangi bir zarardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system.
Re: [PHP] French characters
This doesn't not seem to be having an affect as the French characters are still written scrambled. Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:e2c046087e10d943811a0bd0a4e8316d1bd2e81...@ankara.anadolusigorta.pvt... You may use UTF-8 both in your code and database. It is used more commonly. (almost seems to become a encoding standart) -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 4:08 PM To: php-general@lists.php.net Subject: Re: [PHP] French characters I am using the following code: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:e2c046087e10d943811a0bd0a4e8316d1bd2e81...@ankara.anadolusigorta.pvt... What about browsers encoding? And also, does your html code has a header about character-encoding in french -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 3:58 PM To: php-general@lists.php.net Subject: [PHP] French characters Hi, I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description détaillée After the update:Pas de description détaillée When I read from the table I wrap the data in the following: // Stripslashes if (!get_magic_quotes_gpc()) { $value = stripslashes($value); } // Convert all applicable characters to HTML entities $value = htmlentities($value,ENT_COMPAT); When I update to the table, I wrap in the following: // Addslashes if (!(get_magic_quotes_gpc())) { $value = addslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = @mysql_real_escape_string($value); } I've tried playing with character sets to no avail. There mst be a solution, Thanks Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildiði belirtilen kiþi/kiþilere özeldir ve gizlidir. Size yanlýþlýkla ulaþmýþsa lütfen gönderen kisiyi bilgilendiriniz ve mesajý sisteminizden siliniz. Mesaj ve eklerinin içeriði ile ilgili olarak þirketimizin herhangi bir hukuki sorumluluðu bulunmamaktadýr. Þirketimiz mesajýn ve bilgilerinin size deðiþikliðe uðrayarak veya geç ulaþmasýndan, bütünlüðünün ve gizliliðinin korunamamasýndan, virüs içermesinden ve bilgisayar sisteminize verebileceði herhangi bir zarardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildigi belirtilen kisi/kisilere özeldir ve gizlidir. Size yanlislikla ulasmissa lütfen gönderen kisiyi bilgilendiriniz ve mesaji sisteminizden siliniz. Mesaj ve eklerinin içerigi ile ilgili olarak sirketimizin herhangi bir hukuki sorumlulugu bulunmamaktadir. Sirketimiz mesajin ve bilgilerinin size degisiklige ugrayarak veya geç ulasmasindan, bütünlügünün ve gizliliginin korunamamasindan, virüs içermesinden ve bilgisayar sisteminize verebilecegi herhangi bir zarardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] French characters
Don wrote: I am using the following code: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / Ther emaybe something else setting the charset though. I find the easiest way to check the actual charset that the browser thinks you are using is to open up firefox and go to: Tools - Page Info There you will see the charset type that the browser has found. From what you've shown, either your displaying iso-8859-1 in a UTF-8 context or UTF-8 characters in a iso-8859-1 context. Don't forget to check the following setting in your php.ini: default_charset Personally, I try to use UTF-8 for everything these days since iso-8859-1 is inferior to UTF-8. I would say the Internet at large is moving in this direction... though it still boggles my mind how well Microsoft buggers this up in IE (stuff like displaying a UTF-8 page but completely kludging a download filename which it expects in latin1 despite the presence of the content type -- or having a mailto URL in a UTF-8 context which pops open the Outlook mail client using latin1 assumption for the pre-populated subject line). Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] French characters
- Original Message - From: Phpster phps...@gmail.com To: Don d...@program-it.ca Cc: php-general@lists.php.net Sent: Monday, October 19, 2009 9:33 AM Subject: Re: [PHP] French characters On Oct 19, 2009, at 9:29 AM, Don d...@program-it.ca wrote: This doesn't not seem to be having an affect as the French characters are still written scrambled. Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:E2C046087E10D943811A0BD0A4E8316D1BD2E81C11@ ankara.anadolusigorta.pvt... You may use UTF-8 both in your code and database. It is used more commonly. (almost seems to become a encoding standart) -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 4:08 PM To: php-general@lists.php.net Subject: Re: [PHP] French characters I am using the following code: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:E2C046087E10D943811A0BD0A4E8316D1BD2E81C0E@ ankara.anadolusigorta.pvt... What about browsers encoding? And also, does your html code has a header about character-encoding in french -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 3:58 PM To: php-general@lists.php.net Subject: [PHP] French characters Hi, I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description détaillée After the update:Pas de description détaillée When I read from the table I wrap the data in the following: // Stripslashes if (!get_magic_quotes_gpc()) { $value = stripslashes($value); } // Convert all applicable characters to HTML entities $value = htmlentities($value,ENT_COMPAT); When I update to the table, I wrap in the following: // Addslashes if (!(get_magic_quotes_gpc())) { $value = addslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = @mysql_real_escape_string($value); } I've tried playing with character sets to no avail. There mst be a solution, Thanks Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildiði belirtilen kiþi/kiþilere özeldir ve gizlidir. Size yanlýþlýkla ulaþmýþsa lütfen gönderen kisiyi bilgilendiriniz ve mesajý sisteminizden siliniz. Mesaj ve eklerinin içeriði ile ilgili olarak þirketimizin herhangi bir hukuki sorumluluðu bulunmamaktadý r. Þirketimiz mesajýn ve bilgilerinin size deðiþikliðe uðrayarak veya geç ulaþmasýndan, bütünlüðünün ve gizliliðinin korunamamasýndan, virüs içermesinden ve bilgisayar sisteminize verebileceði herhangi bir zar ardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildigi belirtilen kisi/kisilere öz eldir ve gizlidir. Size yanlislikla ulasmissa lütfen gönderen kisiyi bilgilen diriniz ve mesaji sisteminizden siliniz. Mesaj ve eklerinin içerigi ile ilgi li olarak sirketimizin herhangi bir hukuki sorumlulugu bulunmamaktadir. Sirketimiz mesajin ve bilgilerinin size degisiklige ugrayarak veya g eç ulasmasindan, bütünlügünün ve gizliliginin korunamamasindan, vir üs içermesinden ve bilgisayar sisteminize verebilecegi herhangi bir zar ardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You've used htmlentities to encode the characters, try http://php.net/manual/en/function.html-entity-decode.php to decode the string Bastien= Do you mean like this? When I update to the table, I wrap in the following: // Addslashes if (!(get_magic_quotes_gpc())) { $value = addslashes($value); } // Quote
Re: [PHP] French characters
On Oct 19, 2009, at 9:29 AM, Don d...@program-it.ca wrote: This doesn't not seem to be having an affect as the French characters are still written scrambled. Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:E2C046087E10D943811A0BD0A4E8316D1BD2E81C11@ ankara.anadolusigorta.pvt... You may use UTF-8 both in your code and database. It is used more commonly. (almost seems to become a encoding standart) -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 4:08 PM To: php-general@lists.php.net Subject: Re: [PHP] French characters I am using the following code: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:E2C046087E10D943811A0BD0A4E8316D1BD2E81C0E@ ankara.anadolusigorta.pvt... What about browsers encoding? And also, does your html code has a header about character-encoding in french -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 3:58 PM To: php-general@lists.php.net Subject: [PHP] French characters Hi, I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description détaillée After the update:Pas de description détaillée When I read from the table I wrap the data in the following: // Stripslashes if (!get_magic_quotes_gpc()) { $value = stripslashes($value); } // Convert all applicable characters to HTML entities $value = htmlentities($value,ENT_COMPAT); When I update to the table, I wrap in the following: // Addslashes if (!(get_magic_quotes_gpc())) { $value = addslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = @mysql_real_escape_string($value); } I've tried playing with character sets to no avail. There mst be a solution, Thanks Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildiði belirtilen kiþi/kiþilere özeldir ve gizlidir. Size yanlýþlýkla ulaþmýþsa lütfen gönderen kisiyi bilgilendiriniz ve mesajý sisteminizden siliniz. Mesaj ve eklerinin içeriði ile ilgili olarak þirketimizin herhangi bir hukuki sorumluluðu bulunmamaktadý r. Þirketimiz mesajýn ve bilgilerinin size deðiþikliðe uðrayarak veya geç ulaþmasýndan, bütünlüðünün ve gizliliðinin korunamamasýndan, virüs içermesinden ve bilgisayar sisteminize verebileceði herhangi bir zar ardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildigi belirtilen kisi/kisilere öz eldir ve gizlidir. Size yanlislikla ulasmissa lütfen gönderen kisiyi bilgilen diriniz ve mesaji sisteminizden siliniz. Mesaj ve eklerinin içerigi ile ilgi li olarak sirketimizin herhangi bir hukuki sorumlulugu bulunmamaktadir. Sirketimiz mesajin ve bilgilerinin size degisiklige ugrayarak veya g eç ulasmasindan, bütünlügünün ve gizliliginin korunamamasindan, vir üs içermesinden ve bilgisayar sisteminize verebilecegi herhangi bir zar ardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You've used htmlentities to encode the characters, try http://php.net/manual/en/function.html-entity-decode.php to decode the string Bastien -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] French characters
Phpster phps...@gmail.com wrote in message news:587e29a7-9904-45f2-beb3-b818ed0ca...@gmail.com... On Oct 19, 2009, at 9:29 AM, Don d...@program-it.ca wrote: This doesn't not seem to be having an affect as the French characters are still written scrambled. Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:E2C046087E10D943811A0BD0A4E8316D1BD2E81C11@ ankara.anadolusigorta.pvt... You may use UTF-8 both in your code and database. It is used more commonly. (almost seems to become a encoding standart) -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 4:08 PM To: php-general@lists.php.net Subject: Re: [PHP] French characters I am using the following code: meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 / Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message news:E2C046087E10D943811A0BD0A4E8316D1BD2E81C0E@ ankara.anadolusigorta.pvt... What about browsers encoding? And also, does your html code has a header about character-encoding in french -Original Message- From: Don [mailto:d...@program-it.ca] Sent: Monday, October 19, 2009 3:58 PM To: php-general@lists.php.net Subject: [PHP] French characters Hi, I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description détaillée After the update:Pas de description détaillée When I read from the table I wrap the data in the following: // Stripslashes if (!get_magic_quotes_gpc()) { $value = stripslashes($value); } // Convert all applicable characters to HTML entities $value = htmlentities($value,ENT_COMPAT); When I update to the table, I wrap in the following: // Addslashes if (!(get_magic_quotes_gpc())) { $value = addslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = @mysql_real_escape_string($value); } I've tried playing with character sets to no avail. There mst be a solution, Thanks Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildiði belirtilen kiþi/kiþilere özeldir ve gizlidir. Size yanlýþlýkla ulaþmýþsa lütfen gönderen kisiyi bilgilendiriniz ve mesajý sisteminizden siliniz. Mesaj ve eklerinin içeriði ile ilgili olarak þirketimizin herhangi bir hukuki sorumluluðu bulunmamaktadý r. Þirketimiz mesajýn ve bilgilerinin size deðiþikliðe uðrayarak veya geç ulaþmasýndan, bütünlüðünün ve gizliliðinin korunamamasýndan, virüs içermesinden ve bilgisayar sisteminize verebileceði herhangi bir zar ardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Bu mesaj ve ekleri, mesajda gönderildigi belirtilen kisi/kisilere öz eldir ve gizlidir. Size yanlislikla ulasmissa lütfen gönderen kisiyi bilgilen diriniz ve mesaji sisteminizden siliniz. Mesaj ve eklerinin içerigi ile ilgi li olarak sirketimizin herhangi bir hukuki sorumlulugu bulunmamaktadir. Sirketimiz mesajin ve bilgilerinin size degisiklige ugrayarak veya g eç ulasmasindan, bütünlügünün ve gizliliginin korunamamasindan, vir üs içermesinden ve bilgisayar sisteminize verebilecegi herhangi bir zar ardan sorumlu tutulamaz. This message and attachments are confidential and intended for the individual(s) stated in this message. If you received this message in error, please immediately notify the sender and delete it from your system. Our company has no legal responsibility for the contents of the message and its attachments. Our company shall have no liability for any changes or late receiving, loss of integrity and confidentiality, viruses and any damages caused in anyway to your computer system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You've used htmlentities to encode the characters, try http://php.net/manual/en/function.html-entity-decode.php to decode the string Tries it but no affect. Thanks anyways Bastien= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] French characters
Don wrote: I use PHP to read data form a mysql 5 table. allow the user to edit the data and then update the table. I am having trouble with French characters. Before the update: Pas de description d�taill�e After the update:Pas de description détaillée It is an encoding problem. My Thunderbird is set to use UTF-8 by default so the first line (Before the update:) does not display the sentence properly. It contains ? marks where the French character should be. The second line on the other hand displays the way it should be (AFAIK remember from school :) . So change your html encoding to utf-8 and it should work meta http-equiv=Content-Type content=text/html; charset=utf-8 / Also ensure that your tables are utf8 and the mysql connection talks utf8 by adding running the query SET NAMES 'utf8' after creating the connection. Like so: $conn = mysql_connect($server,$username,$password); mysql_query(SET NAMES 'utf8', $conn); mysql_select_db($database, $conn) This page has a few pointers about switching a MySQL database to UTF-8. Might be worth a quick look http://www.network-technologies.org/tiny.php?id=9 -- John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
-Original Message- From: Ford, Mike [mailto:[EMAIL PROTECTED] Sent: 17 April 2008 12:25 To: php-general@lists.php.net Subject: RE: [PHP] FRench characters not displayed correctly On 17 April 2008 10:05, Robert Cummings advised: On Thu, 2008-04-17 at 10:57 +0200, Angelo Zanetti wrote: Thanks Robert, I have the following headers: http://fr..com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html? HTTP/1.1 Host: fr..com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 ,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr..com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8 If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT If-None-Match: 6b97e-a9d-619b9e80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Thu, 17 Apr 2008 08:31:32 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Connection: Keep-Alive Keep-Alive: timeout=15, max=200 Etag: 6b97e-a9d-619b9e80 - Now I see that the headers have: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Which to me seems like it is sending both ISO-8859-1 and UTF-8? No, that's what kind of content the server is willing to accept from various sources such as POST. Er, no, that's what kind of content the browser is prepared to accept back from the server -- the headers starting from the GET line are what the browser sends to the server as part of the request. The lines starting at the HTTP/1.x line are what the server returns. In this case, you're getting a 304 Not Modified, which means the server is not even serving any content on this request, nor, probably, even a full set of headers -- it's just telling the browser it can use its cached page. To be absolutely sure what the relevant headers are, you need to force the server to send the full page -- usually, the best way to do this is to hold down the Ctrl key whilst clicking the Refresh/Reload button. Incidentally, I notice that what's being served here is a .html page, and the presence of a 304 response, and no PHP headers, suggests it actually is plain HTML, and not a disguised script, so this whole thread is really very OT...!! ;) However, this being the case, it suggests you have a static .html file on your site claiming to be charset=utf-8, but not saved in UTF-8! There are two obvious ways to solve this: (i) convert the file into UTF-8, or (ii) edit it to have the correct charset= value in the tag. -- Mike, thanks very much I have done a ctrl+F5 And have the following: -- http://fr.x.com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html HTTP/1.1 Host: fr.x.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr.xx.com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=5d5af707c9c34205d30708326872ad27 Pragma: no-cache Cache-Control: no-cache HTTP/1.x 200 OK Date: Thu, 24 Apr 2008 08:34:10 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Last-Modified: Sat, 17 Nov 2007 11:40:26 GMT Etag: 6b97e-a9d-619b9e80 Accept-Ranges: bytes Content-Length: 2717 Keep-Alive: timeout=15, max=198 Connection: Keep-Alive Content-Type: text/html I can now see that the response is a 200 OK response. So basically to get these pages to serve the French characters correctly would I need to do the following: (i) convert the file into UTF-8, or (ii) edit it to have the correct charset= value in the tag. When you refer to charset are you referring to: iso-8859-1 or UTF-8? (iii) Also would I need to send the PHP headers as follows: header( 'Content-type: text/html; charset=iso-8859-1' ); (iv) Also does the fact that there is no DOCTYPE declaration have any impact on the showing of the French characters? Anyone who feels like that are able to comment on the above please assist, as it is greatly appreciated. Thanks Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FRench characters not displayed correctly
Hi all. We have taken over a site and a problem we have is that French special characters aren't displaying correctly, they are displaying a weird square block. I have checked the content type and it's as follows: meta http-equiv=Content-Type content=text/html;charset=utf-8 I also notice that the charset=iso-8859-1 is missing in the above meta tag, could this be affecting the characters? I have seen that there is no DOCTYPE declaration, could this be the problem if this is omitted? If you have any suggestions, please let me know. TIA. Angelo Web: http://www.elemental.co.za -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
-Original Message- From: Angelo Zanetti [mailto:[EMAIL PROTECTED] Sent: 17 April 2008 09:48 To: php-general@lists.php.net Subject: [PHP] FRench characters not displayed correctly Hi all. We have taken over a site and a problem we have is that French special characters aren't displaying correctly, they are displaying a weird square block. I have checked the content type and it's as follows: meta http-equiv=Content-Type content=text/html;charset=utf-8 I also notice that the charset=iso-8859-1 is missing in the above meta tag, could this be affecting the characters? I have seen that there is no DOCTYPE declaration, could this be the problem if this is omitted? If you have any suggestions, please let me know. TIA. Angelo Web: http://www.elemental.co.za I have also found that we can do this: html lang=fr But I am interested in finding out if the doctype declaration is a contributing factor. Thanks Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FRench characters not displayed correctly
On Thu, 2008-04-17 at 09:47 +0200, Angelo Zanetti wrote: Hi all. We have taken over a site and a problem we have is that French special characters aren't displaying correctly, they are displaying a weird square block. I have checked the content type and it's as follows: meta http-equiv=Content-Type content=text/html;charset=utf-8 I also notice that the charset=iso-8859-1 is missing in the above meta tag, could this be affecting the characters? You certainly wouldn't want both utf-8 and iso-8859-1 declared at the same time. It sounds like what you want is iso-8859-1 and NOT utf-8. Check the encoding of either your files or your database content. Also check what headers PHP is sending to the browser. If you're using Firefox you can check the page info to see what charset it thinks it received. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] French characters not displayed correctly
Angelo Zanetti wrote: I have also found that we can do this: html lang=fr But I am interested in finding out if the doctype declaration is a contributing factor. Neither will affect the character set used when rendering the page. The meta http-equiv=Content-Type in a page is ignored by the browser if an http header with a Content-Type has already been sent. If you bring up the page in Firefox, and hit Ctrl-I, I'll bet it says the page is being displayed in ISO-8859-1 (well, not UTF8 at least). I would check the default_charset setting in php.ini. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: 17 April 2008 10:38 To: Angelo Zanetti Cc: php-general@lists.php.net Subject: Re: [PHP] FRench characters not displayed correctly On Thu, 2008-04-17 at 09:47 +0200, Angelo Zanetti wrote: Hi all. We have taken over a site and a problem we have is that French special characters aren't displaying correctly, they are displaying a weird square block. I have checked the content type and it's as follows: meta http-equiv=Content-Type content=text/html;charset=utf-8 I also notice that the charset=iso-8859-1 is missing in the above meta tag, could this be affecting the characters? You certainly wouldn't want both utf-8 and iso-8859-1 declared at the same time. It sounds like what you want is iso-8859-1 and NOT utf-8. Check the encoding of either your files or your database content. Also check what headers PHP is sending to the browser. If you're using Firefox you can check the page info to see what charset it thinks it received. Cheers, Rob. -- Thanks Robert, I have the following headers: http://fr..com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html? HTTP/1.1 Host: fr..com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr..com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8 If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT If-None-Match: 6b97e-a9d-619b9e80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Thu, 17 Apr 2008 08:31:32 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Connection: Keep-Alive Keep-Alive: timeout=15, max=200 Etag: 6b97e-a9d-619b9e80 - Now I see that the headers have: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Which to me seems like it is sending both ISO-8859-1 and UTF-8? What else should I be checking for? Could it be a PHP problem where PHP isn't decoding the characters properly? Thanks again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
On Thu, 2008-04-17 at 10:57 +0200, Angelo Zanetti wrote: Thanks Robert, I have the following headers: http://fr..com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html? HTTP/1.1 Host: fr..com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr..com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8 If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT If-None-Match: 6b97e-a9d-619b9e80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Thu, 17 Apr 2008 08:31:32 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Connection: Keep-Alive Keep-Alive: timeout=15, max=200 Etag: 6b97e-a9d-619b9e80 - Now I see that the headers have: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Which to me seems like it is sending both ISO-8859-1 and UTF-8? No, that's what kind of content the server is willing to accept from various sources such as POST. You want the following somewhere near the beginning of your script: ?php header( 'Content-type: text/html; charset=iso-8859-1' ); ? Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
-Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: 17 April 2008 11:05 To: Angelo Zanetti Cc: php-general@lists.php.net Subject: RE: [PHP] FRench characters not displayed correctly On Thu, 2008-04-17 at 10:57 +0200, Angelo Zanetti wrote: Thanks Robert, I have the following headers: http://fr..com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html? HTTP/1.1 Host: fr..com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr..com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8 If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT If-None-Match: 6b97e-a9d-619b9e80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Thu, 17 Apr 2008 08:31:32 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Connection: Keep-Alive Keep-Alive: timeout=15, max=200 Etag: 6b97e-a9d-619b9e80 - Now I see that the headers have: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Which to me seems like it is sending both ISO-8859-1 and UTF-8? No, that's what kind of content the server is willing to accept from various sources such as POST. You want the following somewhere near the beginning of your script: ?php header( 'Content-type: text/html; charset=iso-8859-1' ); ? Cheers, Rob. - Thanks again, but as far as I have read, it seems that UTF-8 has better handling for French characters? We have the following in our HTML page: meta http-equiv=Content-Type content=text/html;charset=utf-8 Would the header not conflict with this meta tag? Angelo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
On Thu, 2008-04-17 at 11:11 +0200, Angelo Zanetti wrote: -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: 17 April 2008 11:05 To: Angelo Zanetti Cc: php-general@lists.php.net Subject: RE: [PHP] FRench characters not displayed correctly On Thu, 2008-04-17 at 10:57 +0200, Angelo Zanetti wrote: Thanks Robert, I have the following headers: http://fr..com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html? HTTP/1.1 Host: fr..com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr..com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8 If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT If-None-Match: 6b97e-a9d-619b9e80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Thu, 17 Apr 2008 08:31:32 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Connection: Keep-Alive Keep-Alive: timeout=15, max=200 Etag: 6b97e-a9d-619b9e80 - Now I see that the headers have: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Which to me seems like it is sending both ISO-8859-1 and UTF-8? No, that's what kind of content the server is willing to accept from various sources such as POST. You want the following somewhere near the beginning of your script: ?php header( 'Content-type: text/html; charset=iso-8859-1' ); ? Cheers, Rob. - Thanks again, but as far as I have read, it seems that UTF-8 has better handling for French characters? We have the following in our HTML page: meta http-equiv=Content-Type content=text/html;charset=utf-8 Would the header not conflict with this meta tag? You can't just change the header or meta tags and expect things to work. The header must match the type of content you have. The point of th eheader is to tell the browser what all those multi-byte sequences mean. If you want to change to UTF-8 and your data is in ISO-8859-1 then you need to convert the content from one type to the other (I usually use iconv on the command-line). Until you do so, you should set your header to whatever content type you have... I'm guessing ISO-8859-1 but maybe you have UTF-8. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
Angelo Zanetti wrote: Thanks again, but as far as I have read, it seems that UTF-8 has better handling for French characters? Not really - I'm pretty certain ISO-8859-1 will cover all of the special french characters. But it's irrelevant - if your code/pages are written in UTF8, you won't get the desired result if you serve them as ISO-8859-1. We have the following in our HTML page: meta http-equiv=Content-Type content=text/html;charset=utf-8 Would the header not conflict with this meta tag? No, your header didn't have a Content-Type listed, so I think your meta-tag should work. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
Robert Cummings wrote: No, that's what kind of content the server is willing to accept from various sources such as POST. You want the following somewhere near the beginning of your script: ?php header( 'Content-type: text/html; charset=iso-8859-1' ); ? I think that is better done with the default_charset setting in php.ini. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
On Thu, 2008-04-17 at 11:39 +0200, Per Jessen wrote: Robert Cummings wrote: No, that's what kind of content the server is willing to accept from various sources such as POST. You want the following somewhere near the beginning of your script: ?php header( 'Content-type: text/html; charset=iso-8859-1' ); ? I think that is better done with the default_charset setting in php.ini. I don't. But then I have several projects and some use utf-8 (preferred) and some use iso-8859-1 (not preferred). I prefer it in the virtual host config personally :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
Robert Cummings wrote: ?php header( 'Content-type: text/html; charset=iso-8859-1' ); ? I think that is better done with the default_charset setting in php.ini. I don't. But then I have several projects and some use utf-8 (preferred) and some use iso-8859-1 (not preferred). I prefer it in the virtual host config personally :) Ah yes, that's what I meant of course. (I actually do everything in UTF8 anyway). /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
On 17 April 2008 10:05, Robert Cummings advised: On Thu, 2008-04-17 at 10:57 +0200, Angelo Zanetti wrote: Thanks Robert, I have the following headers: http://fr..com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html? HTTP/1.1 Host: fr..com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 ,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr..com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8 If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT If-None-Match: 6b97e-a9d-619b9e80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Thu, 17 Apr 2008 08:31:32 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Connection: Keep-Alive Keep-Alive: timeout=15, max=200 Etag: 6b97e-a9d-619b9e80 - Now I see that the headers have: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Which to me seems like it is sending both ISO-8859-1 and UTF-8? No, that's what kind of content the server is willing to accept from various sources such as POST. Er, no, that's what kind of content the browser is prepared to accept back from the server -- the headers starting from the GET line are what the browser sends to the server as part of the request. The lines starting at the HTTP/1.x line are what the server returns. In this case, you're getting a 304 Not Modified, which means the server is not even serving any content on this request, nor, probably, even a full set of headers -- it's just telling the browser it can use its cached page. To be absolutely sure what the relevant headers are, you need to force the server to send the full page -- usually, the best way to do this is to hold down the Ctrl key whilst clicking the Refresh/Reload button. Incidentally, I notice that what's being served here is a .html page, and the presence of a 304 response, and no PHP headers, suggests it actually is plain HTML, and not a disguised script, so this whole thread is really very OT...!! ;) However, this being the case, it suggests you have a static .html file on your site claiming to be charset=utf-8, but not saved in UTF-8! There are two obvious ways to solve this: (i) convert the file into UTF-8, or (ii) edit it to have the correct charset= value in the tag. Cheers! -- Mike Ford, Electronic Information Services Adviser, JG125, The Headingley Library, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 812 4730 Fax: +44 113 812 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FRench characters not displayed correctly
On Thu, 2008-04-17 at 11:24 +0100, Ford, Mike wrote: On 17 April 2008 10:05, Robert Cummings advised: On Thu, 2008-04-17 at 10:57 +0200, Angelo Zanetti wrote: Thanks Robert, I have the following headers: http://fr..com/student/themes/english/locker_room/student.html GET /student/themes/english/locker_room/student.html? HTTP/1.1 Host: fr..com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 ,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://fr..com/student/themes/english/locker_room/student.html Cookie: PHPSESSID=818678404c170c8e4f5d237c1d0280a8 If-Modified-Since: Sat, 17 Nov 2007 11:40:26 GMT If-None-Match: 6b97e-a9d-619b9e80 Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Thu, 17 Apr 2008 08:31:32 GMT Server: Apache/2.0.55 (Unix) PHP/5.1.2 Connection: Keep-Alive Keep-Alive: timeout=15, max=200 Etag: 6b97e-a9d-619b9e80 - Now I see that the headers have: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Which to me seems like it is sending both ISO-8859-1 and UTF-8? No, that's what kind of content the server is willing to accept from various sources such as POST. Er, no, that's what kind of content the browser is prepared to accept back from the server -- the headers starting from the GET line are what the browser sends to the server as part of the request. The lines starting at the HTTP/1.x line are what the server returns. Good catch, I must have crossed wires somewhere in my head and thought about the accept-charset attribute for forms which *is* what the server is willing to accept when processing the form. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php