Re: LENGTH() and UTF-8

2005-05-09 Thread Andreas Steichardt
On Monday 09 May 2005 12:24, John Doe wrote: > Am Montag, 9. Mai 2005 11.55 schrieb Andreas Steichardt: > > Hi! > > > > We are storing UTF-8 data in out mysql database and we need to get the > > length of the data. But length() doesn't return the number of characters > > but the pure number of byte

Re: LENGTH() and UTF-8

2005-05-09 Thread Jochem van Dieten
On 5/9/05, Andreas Steichardt wrote: > > We are storing UTF-8 data in out mysql database and we need to get the > length > of the data. But length() doesn't return the number of characters but the > pure number of bytes. Look at OCTET_LENGTH() and CHAR_LENGTH(). (While OCTET_LENGTH() is a synon

Re: LENGTH() and UTF-8

2005-05-09 Thread John Doe
Am Montag, 9. Mai 2005 11.55 schrieb Andreas Steichardt: > Hi! > > We are storing UTF-8 data in out mysql database and we need to get the > length of the data. But length() doesn't return the number of characters > but the pure number of bytes. > > SELECT LENGTH('köter') => 6 > > Currently we are d

LENGTH() and UTF-8

2005-05-09 Thread Andreas Steichardt
Hi! We are storing UTF-8 data in out mysql database and we need to get the length of the data. But length() doesn't return the number of characters but the pure number of bytes. SELECT LENGTH('köter') => 6 Currently we are doing something like that: SELECT LENGTH(CONVERT('köter' USING 'ucs2')