pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 荒井元成 <n2029@ndensan.co.jp>
To: 'Holger Jakobs' <holger@jakobs.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: RE: Re: About Unicode IVS
Date: Wed, 30 Mar 2022 09:06:06 +0900
Message-ID: <001801d843c9$f39d4f10$dad7ed30$@ndensan.co.jp> (raw)
In-Reply-To: <8cbb85bf50e6354095b09548a54ec1d8@ndensan.co.jp>
References: <8cbb85bf50e6354095b09548a54ec1d8@ndensan.co.jp>


Variant forms cannot be solved by normalization.

Moto.

-------- 元のメッセージ --------
件名: Re: About Unicode IVS
日付: 2022-03-29 19:02
発信者: Holger Jakobs <holger@jakobs.com>
宛先: pgsql-admin@lists.postgresql.org



It's totally correct that the two characters are still two characters.

You would have to normalize the string first, so that the combination becomes one character.

More information about this topic, which is in part beyond PostgreSQL:

  	*
https://stackoverflow.com/questions/7931204/what-is-normalized-utf-8-all-about
[1]
  	* https://en.wikipedia.org/wiki/Unicode_equivalence [2]

Regards,

Holger

Am 29.03.22 um 11:55 schrieb 荒井元成:

> thank you for your reply.
> 
> Changing the collation order and CTYPE did not change the behavior.
> 
> 名前 | 所有者 | エンコーディング | 照合順序
> | Ctype(変換演算子) | アクセス権限
> 
> 
-----------+---------+------------------+-------------+-------------------+---------------------
> 
> 
> D209007 | D209007 | UTF8 | C | C
> |
> 
> postgres | D209007 | UTF8 | C | C
> |
> 
> template0 | D209007 | UTF8 | C | C
> | =c/D209007 +
> 
> | | | |
> | D209007=CTc/D209007
> 
> template1 | D209007 | UTF8 | C | C
> | =c/D209007 +
> 
> | | | |
> | D209007=CTc/D209007
> 
> template2 | D209007 | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8
> |
> 
> (5 行)
> 
> D209007=# c template2
> 
> 
データベース"template2"にユーザ"D209007"として接続しました。
> 
> 
> template2=# select char_length(U&'+0000E6' || U&'+000300');
> 
> char_length
> 
> -------------
> 
> 2
> 
> (1 行)
> 
> template2=# select char_length(U&'+008FBA' || U&'+0E0102');
> 
> char_length
> 
> -------------
> 
> 2
> 
> (1 行)
> 
> template2=# select length(U&'+008FBA' || U&'+0E0102');
> 
> length
> 
> --------
> 
> 2
> 
> (1 行)
> 
> Moto.
> 
> FROM: Michel SALAIS <msalais@msym.fr>
> SENT: Tuesday, March 29, 2022 6:35 PM
> TO: '荒井元成' <n2029@ndensan.co.jp>; 'David G. Johnston'
> <david.g.johnston@gmail.com>
> CC: pgsql-admin@lists.postgresql.org
> SUBJECT: RE: About Unicode IVS
> 
> Hi,
> 
> I think this has something to do with collation and ctype. As I see 
> you have it set to “C” for all your databases (even if I don’t 
> understand your titles 😊).
> 
> _Michel SALAIS_
> 
> _ _
> 
> DE : 荒井元成 <n2029@ndensan.co.jp>
> ENVOYÉ : mardi 29 mars 2022 06:35
> À : 'David G. Johnston' <david.g.johnston@gmail.com> CC : 
> pgsql-admin@lists.postgresql.org OBJET : RE: About Unicode IVS
> 
> thank you for your reply.
> 
> It will be 2 characters.
> 
> select char_length(U&'+008FBA' || U&'+0E0102');
> 
> char_length
> 
> -------------
> 
> 2
> 
> (1 行)
> 
> select length('辺󠄂');
> 
> length
> 
> --------
> 
> 2
> 
> (1 行)
> 
> select char_length('辺󠄂');
> 
> char_length
> 
> -------------
> 
> 2
> 
> (1 行)
> 
> $ psql -l
> 
> データベース一覧
> 
> 名前 | 所有者 | エンコーディング | 照合順序 |
> Ctype(変換演算子) | アクセス権限
> 
> 
-----------+---------+------------------+----------+-------------------+---------------------
> 
> 
> D209007 | D209007 | UTF8 | C | C
> |
> 
> postgres | D209007 | UTF8 | C | C
> |
> 
> template0 | D209007 | UTF8 | C | C
> | =c/D209007 +
> 
> | | | |
> | D209007=CTc/D209007
> 
> template1 | D209007 | UTF8 | C | C
> | =c/D209007 +
> 
> | | | |
> | D209007=CTc/D209007
> 
> (4 行)
> 
> $ cat pgdata/PG_VERSION
> 
> 13
> 
> Moto.
> 
> FROM: David G. Johnston <david.g.johnston@gmail.com>
> SENT: Tuesday, March 29, 2022 12:38 PM
> TO: 荒井元成 <n2029@ndensan.co.jp>
> CC: pgsql-admin@lists.postgresql.org
> SUBJECT: Re: About Unicode IVS
> 
> On Monday, March 28, 2022, 荒井元成 <n2029@ndensan.co.jp> wrote:
> 
>> Hi,
>> 
>> In the Length () function, it will be 2 characters where you want it 
>> to be 1 character.
>> 
>> Is it possible to respond by changing the settings such as changing 
>> the collation setting like SQL Server?
>> 
>> Also, if you understand how to deal with it (eg, create your own 
>> function), it would be helpful if you could provide as much 
>> information as you can.
> 
> Try char_length(text) instead.
> 
> David J.

--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012


Links:
------
[1] 
https://stackoverflow.com/questions/7931204/what-is-normalized-utf-8-all-about
[2] https://en.wikipedia.org/wiki/Unicode_equivalence






view thread (13+ messages)

Message-ID: <001801d843c9$f39d4f10$dad7ed30$@ndensan.co.jp>
Permalink:  ../001801d843c9$f39d4f10$dad7ed30$@ndensan.co.jp/
Also on:    postgresql.org/message-id/001801d843c9$f39d4f10$dad7ed30$@ndensan.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: n2029@ndensan.co.jp, holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: RE: Re: About Unicode IVS
  In-Reply-To: <001801d843c9$f39d4f10$dad7ed30$@ndensan.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox