[TYPO3-dev] OT: special characters in SQL

Christian Lerrahn typo3 at penpal4u.net
Tue Mar 7 13:37:18 CET 2006


On Tue, 07 Mar 2006 09:23:19 +0100
Martin Kutschker <Martin.Kutschker at n0spam-blackbox.net> wrote:

> Christian Lerrahn schrieb:
> > If I write e.g. an "ö", the editor will choose some encoding
> > which might be different from the server's default.
> 
> How come? Where does the editor enter the strings? The charset of FE and BE 
> is known, so you can do any transformation you might want. But betware not 
> all languages have a correct sorting if you simply strip any accents and eg 
> Spanish regards "ll" as a distintc character (sorted I think after "l").

I am aware of that but didn't really plan to work around that. For the
alpha version I'm happy with a solution that works for small websites.

> If you simply want to strip the accents use t3lib_cs->specToAscii(). 
> Otherwise store your data in UTF-8 and follow Dimitri's advice and use 
> Mysql's collate feature.

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?

Cheers,
Christian

-- 
    /Der Herr sprach zu Mose:/ Ich will ihnen einen Propheten, wie du
    bist, erwecken aus ihren Brüdern und meine Worte in  seinen  Mund
    geben.
    
    5.Mose 18,18
    
    Ist  jemand  prophetische Rede gegeben, so übe er sie dem Glauben
    gemäß.
    
    Römer 12,6
    




More information about the TYPO3-dev mailing list