Skip site navigation (1) Skip section navigation (2)

Re: Patch to make Turks happy.

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch to make Turks happy.
Date: 2002-12-05 06:18:46
Message-ID: 200212050618.gB56IkZ29683@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
I am not going to apply this patch because I think it will mess up the
handling of other locales.


---------------------------------------------------------------------------

Nicolai Tufar wrote:
> Hi,
> 
> Yet another problem with Turkish encoding. clean_encoding_name()
> in src/backend/utils/mb/encnames.c uses tolower() to convert locale
> names to lower-case. This causes errors if locale name contains
> capital "I" and current olcale is Turkish. Some examples:
> 
> aaa=# \l
>       List of databases
>    Name    | Owner | Encoding
> -----------+-------+----------
>  aaa       | pgsql | LATIN5
>  bbb       | pgsql | LATIN5
>  template0 | pgsql | LATIN5
>  template1 | pgsql | LATIN5
> (4 rows)
> aaa=# CREATE DATABASE ccc ENCODING='LATIN5';
> ERROR:  LATIN5 is not a valid encoding name
> aaa=# \encoding
> SQL_ASCII
> aaa=# \encoding SQL_ASCII
> SQL_ASCII: invalid encoding name or conversion procedure not found
> aaa=# \encoding LATIN5
> LATIN5: invalid encoding name or conversion procedure not found
> 
> 
> Patch, is a simple change to use ASCII-only lower-case conversion 
> instead of locale-dependent tolower()
> 
> Best regards,
> Nic.
> 
> 
> 
> 
> 
> 
> *** ./src/backend/utils/mb/encnames.c.orig	Mon Dec  2 15:58:49 2002
> --- ./src/backend/utils/mb/encnames.c	Mon Dec  2 18:13:23 2002
> ***************
> *** 407,413 ****
>   	for (p = key, np = newkey; *p != '\0'; p++)
>   	{
>   		if (isalnum((unsigned char) *p))
> ! 			*np++ = tolower((unsigned char) *p);
>   	}
>   	*np = '\0';
>   	return newkey;
> --- 407,416 ----
>   	for (p = key, np = newkey; *p != '\0'; p++)
>   	{
>   		if (isalnum((unsigned char) *p))
> ! 			if (*p >= 'A' && *p <= 'Z')
> ! 				*np++ = *p + 'a' - 'A';
> ! 			else
> ! 				*np++ = *p;
>   	}
>   	*np = '\0';
>   	return newkey;
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2002-12-05 06:21:12
Subject: Re: 7.4 Wishlist
Previous:From: Bruce MomjianDate: 2002-12-05 06:17:03
Subject: Re: Compiere "embedded transactions"

pgsql-patches by date

Next:From: Bruce MomjianDate: 2002-12-05 06:24:25
Subject: Re: patch for pgsql/doc/src/sgml/runtime
Previous:From: Joe ConwayDate: 2002-12-05 06:12:06
Subject: md5

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group