[DC-1033] [PATCH] Use multibyte version of strtolower Created: 28/Aug/11  Updated: 28/Aug/11

Status: Open
Project: Doctrine 1
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Jonas Flodén Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 0
Labels: None
Environment:

PHP 5.3.7, Symfony 1.4.13


Attachments: Text File 0001-Use-multibyte-version-of-strtolower.patch    

 Description   

While trying to develop a new Symfony frontend to an existing database - whcih unfortunately contains non-ascii character names - I ran into a lot of problems where non-ascii characters had been mangled.
After installing XDebug and digging into the issue I found that the use of strtolower on the column names was the issue, since it's not safe to use on UTF-8 strings.
I replaced all calls to strtolower with mb_strtolower and UTF-8 encoding which solved my issue. I don't know if that is the correct way of doing it or if there is a better way.
I saw one other use of mb_strtolower in doctrine and it was guarded with an if function exists... Also it might be an issue in other files as well...
I provide my patch file incase it is of any use.



 Comments   
Comment by Jonas Flodén [ 28/Aug/11 ]

Here is a Git pull request with the same patch:
https://github.com/doctrine/doctrine1/pull/39

Generated at Thu Oct 30 19:25:24 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.