Bug Report #3210
Kohana core fails if php file saved in not utf-8 encoding
|Assignee:||Woody Gilk||% Done:||
Kohana fails badly with
ErrorException [ 2 ]: htmlspecialchars(): Invalid multibyte sequence in argument ~ SYSPATH\classes\kohana\core.php [ 1355 ]
when php file have comment in national language, and saved in other than utf-8 encoding (in my case is cp1251 standard windows encoding for russia)
as i understand that error is rised when error reporting mechanism tries to display this comment, when i save php in utf-8 everything is fine.
Updated by Jeremy Bush over 2 years ago
Try changing Kohana::$charset
I had a similar problem with incoming emails in unknown charsets.
Updated by Alexey Kruchenok over 2 years ago
in my case change to utf-8 encoding work pretty fine. But i think that "ErrorException [ 2 ]: htmlspecialchars(): Invalid multibyte sequence in argument " is very confusing behavor.
Updated by Isaiah DeRose-Wilson over 2 years ago
- Subject changed from Cohana core fails if php file saved in not utf-8 encoding to Kohana core fails if php file saved in not utf-8 encoding
Updated by Woody Gilk over 2 years ago
- Category set to Core
- Status changed from New to Closed
- Assignee set to Woody Gilk
- Target version set to v3.0.8
- Resolution set to invalid
Kohana cannot detect these kinds issues and provide more information. You need to ensure that your environment works properly by using a single character set (preferably "utf-8") for all files, as well as input and output. Kohana can help with the input and output, but not much else.