[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

PHP 5.3.7, Symfony 1.4.13

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


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.

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

Here is a Git pull request with the same patch:

Generated at Fri Aug 28 01:24:39 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.