tallberg Posted May 10, 2010 Share Posted May 10, 2010 Hi i recenty resaved a file in utf-8 so that i can have japanese text. However, my php system seem to requires that my files remain in ANSI in order to work. The error Content Encoding Error The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/201234-encoding-error/ Share on other sites More sharing options...
ChemicalBliss Posted May 10, 2010 Share Posted May 10, 2010 Quite a few ideas, depending on your situation. First: http://support.mozilla.com/tiki-view_forum_thread.php?locale=eu&comments_parentId=88187&forumId=1 Next, http://www.phpwact.org/php/i18n/charsets#checking_utf-8_for_well_formedness Then adding the codes from this part (Headers must be before _any_ HTML output), http://www.phpwact.org/php/i18n/charsets#practical_issues Content encoding is an issue in PHP but can be handled when you know the qwerks. -cb- Quote Link to comment https://forums.phpfreaks.com/topic/201234-encoding-error/#findComment-1055749 Share on other sites More sharing options...
tallberg Posted May 12, 2010 Author Share Posted May 12, 2010 Thanks for you reply I managed to display japanese characters that are hard coded in to the page and get the shopping cart working with the file saved as utf8 but i dont seem to be able to retreive japanese from the database. Ive tryed changing the collation of the field to ucs2_bin, ujis_japanese_ci, sjis_japanese_ci, cp932_japanese_ci and this has had no effect. Any ideas would be great? Quote Link to comment https://forums.phpfreaks.com/topic/201234-encoding-error/#findComment-1057022 Share on other sites More sharing options...
ChemicalBliss Posted May 13, 2010 Share Posted May 13, 2010 I would personally encode the values of japanese characters before inserting them into the DB, then just decode them once they are out. Messing with table encodings can be a real headache, especially for multiple languages (as you have, english and japanese), just stick to english and encode everything you cant natively support. (This is obviously the lazy way, but effective - will perhaps cost space and performace, though hardly recognizable) -cb- Quote Link to comment https://forums.phpfreaks.com/topic/201234-encoding-error/#findComment-1057806 Share on other sites More sharing options...
tallberg Posted May 13, 2010 Author Share Posted May 13, 2010 Im not sure what you mean. Why I stuck the charater in a normal TEXT field with the default collation the charater just changed in ?????????????????????????????????? What do mean by encoding the everything thing i cant natively support? Thanks for the imformative replay. Quote Link to comment https://forums.phpfreaks.com/topic/201234-encoding-error/#findComment-1057843 Share on other sites More sharing options...
ChemicalBliss Posted May 20, 2010 Share Posted May 20, 2010 Ok,basically use utf8_decode on anything going into your script, like from form inputs. Then use utf8_encode on anything going out (Output HTML). PHP doesnt handle utf8 very well. Best to avoid it imo - until php6 comes along. -cb- Quote Link to comment https://forums.phpfreaks.com/topic/201234-encoding-error/#findComment-1061078 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.