[TYPO3-dev] OT: special characters in SQL
Christian Lerrahn
typo3 at penpal4u.net
Wed Mar 15 09:47:59 CET 2006
Dimitri and Masi,
> > On 3/7/06, Christian Lerrahn <typo3 at penpal4u.net> wrote:
> >
> >
> >>The COLLTE function doesn't really help much. My problem is not the
> >>sorting but the WHERE clause. I have a WHERE clause like "WHERE title
> >>LIKE 'A%'" I now want to add " OR title LIKE 'Ä%'" so that Ä would be
> >>listed together with A. I think I'd have to manually link Ä to A but this
> >>is where the problem arises. How do I have to encode "Ä" in the script
> >>that it is later read in the correct way? Is this system dependent?
> >
> >
> > No, it's not system dependent if you stick to UTF. You'll probably
> > need to make sure mbstring settings are correct if you start chopping
> > off first 1 character from a string like that.
>
> Yep, either store only this field in in UTF-8 or easer use
> forceCharset=utf-8 and use utf-8 for the BE and the FE. If you don't want
> to use forceCharset=utf-8 then you have to do the conversion manually (use
> the functions in t3lib_cs).
Fact is that I have a script that is completely encoded in UTF-8 and sends
an SQL query to the server like "SELECT * FROM pages WHERE title LIKE
'Ü%'" but misses out a page called "Über uns" that I will find if I use
the same query on phpmyadmin. So obviously the MySQL server is expecting
something else but UTF-8! But will it always expect the same encoding?
And which one would this be then?
Cheers,
Christian
--
Gedenkt des Herrn in fernem Lande und lasst euch Jerusalem im
Herzen sein!
Jeremia 51,50
/Christus spricht:/ Der Tröster, der Heilige Geist, den mein
Vater senden wird in meinem Namen, der wird euch alles lehren und
euch an alles erinnern, was ich euch gesagt habe.
Johannes 14,26
More information about the TYPO3-dev
mailing list