Re: UTF-8 collation on Windows?

From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: UTF-8 collation on Windows?
Date: 2014-02-19 21:09:33
Message-ID: CALSLE1MSS0Vvj2bAck1-nQpX+08aSjEGEvw12+10kfGsg=7BTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 20, 2014 at 2:24 AM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>wrote:

> Alright last shot:)
>
> Taking hint from here:
>
> http://msdn.microsoft.com/en-us/library/x99tb11d.aspx
>
> try:
>
> createdb -U postgres -E utf8 -l en-US <DBNAME>
>
> If that does not work, not sure where to go.

This won't work on Windows. Note that en-US collation name is specific to
linux and in case of Windows these names are different which is where am
facing issues to find the exact code page which corresponds to utf8.

Your msdn link has this mentioned which states that for code pages that
require more than two bytes per character which is basically UTF8 doesn't
work with setlocale command. But again its specific to the setlocale API.

*"The locale argument can take a locale name, a language string, a language
string and country/region code, a code page, or a
language string, country/region code, and code page. The set of available
locale names, languages, country/region codes, and code
pages includes all those supported by the Windows NLS API except code pages
that require more than two bytes per character, such as
UTF-7 and UTF-8. If you provide a code page value of UTF-7 or UTF-8,
setlocale will fail, returning NULL.*"

However am sure there would be some codepage which can be used in
postgreSQL to set the collation to UTF8 equivalent of linux.

Please suggest? Am sure this not something new which am looking for.

Regards...

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-02-19 21:11:30 Re: Timezone information
Previous Message Andrew Sullivan 2014-02-19 21:02:29 Re: Timezone information