Обсуждение: BUG #5903: Turkish encoding problem

Поиск
Список
Период
Сортировка

BUG #5903: Turkish encoding problem

От
"Sarp Akal"
Дата:
The following bug has been logged online:

Bug reference:      5903
Logged by:          Sarp Akal
Email address:      sarp@dms-tech.com
PostgreSQL version: 9.0.2
Operating system:   Windows Server 2008 R2 x64
Description:        Turkish encoding problem
Details:

The server is setup for UTF8 encoding and collation and character type are
Turkish_Turkey.1254

The following code fails:

select lower('Ä°')  --> Lowercase of turkish capital I-with dot returns
exactly the same character.

select upper('ı')  --> Uppercase of turkish small i-without dot returns
exactly the same character.

select lower('I')  --> Lowercase of turkish capital I returns i where it
should be i-without dot.

select upper('i')  --> Uppercase of turkish small returns I where it should
be I-with dot.

Re: BUG #5903: Turkish encoding problem

От
Robert Haas
Дата:
On Tue, Mar 1, 2011 at 1:59 AM, Sarp Akal <sarp@dms-tech.com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: =C2=A0 =C2=A0 =C2=A05903
> Logged by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Sarp Akal
> Email address: =C2=A0 =C2=A0 =C2=A0sarp@dms-tech.com
> PostgreSQL version: 9.0.2
> Operating system: =C2=A0 Windows Server 2008 R2 x64
> Description: =C2=A0 =C2=A0 =C2=A0 =C2=A0Turkish encoding problem
> Details:
>
> The server is setup for UTF8 encoding and collation and character type are
> Turkish_Turkey.1254
>
> The following code fails:
>
> select lower('=C4=B0') =C2=A0--> Lowercase of turkish capital I-with dot =
returns
> exactly the same character.
>
> select upper('=C4=B1') =C2=A0--> Uppercase of turkish small i-without dot=
 returns
> exactly the same character.
>
> select lower('I') =C2=A0--> Lowercase of turkish capital I returns i wher=
e it
> should be i-without dot.
>
> select upper('i') =C2=A0--> Uppercase of turkish small returns I where it=
 should
> be I-with dot.

I might be wrong about this, but I think this behavior is determined
by the operating system behavior of the locale you've selected, and we
just believe whatever the OS says.

--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re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SANClJvYmVydCBIYWFzDQpF
bnRlcnByaXNlREI6IGh0dHA6Ly93d3cuZW50ZXJwcmlzZWRiLmNvbQ0KVGhl
IEVudGVycHJpc2UgUG9zdGdyZVNRTCBDb21wYW55DQoNCg0K

Re: BUG #5903: Turkish encoding problem

От
Devrim GÜNDÜZ
Дата:
On Wed, 2011-06-01 at 09:52 +0000, DMS Tech, Sarp wrote:
> When we run an application on the same machine & OS, application's
> lower and upper functions results are correct but PostgreSQL does not
> behave similar.

Upgrade to *nix. I have heard several similar complaints on Windows. All
recent (7 years and up) glibc releases have proper tr_TR.UTF-8 support.
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

Re: BUG #5903: Turkish encoding problem

От
Robert Haas
Дата:
2011/6/1 Devrim G=DCND=DCZ <devrim@gunduz.org>:
> On Wed, 2011-06-01 at 09:52 +0000, DMS Tech, Sarp wrote:
>> When we run an application on the same machine & OS, application's
>> lower and upper functions results are correct but PostgreSQL does not
>> behave similar.
>
> Upgrade to *nix. I have heard several similar complaints on Windows. All
> recent (7 years and up) glibc releases have proper tr_TR.UTF-8 support.

That's not really much of an answer, since the OP claimed that this
wasn't happening in other applications that use that locale on the
same machine.  It's possible that we're calling the wrong locale-aware
functions on Windows, or just different ones, but I wouldn't even know
where to start looking for that sort of problem.

--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company