Re: BUG #14038: substring cuts unicode char in half, allowing to save broken utf8 into table - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #14038: substring cuts unicode char in half, allowing to save broken utf8 into table
Date
Msg-id 22852.1458578790@sss.pgh.pa.us
Whole thread Raw
In response to BUG #14038: substring cuts unicode char in half, allowing to save broken utf8 into table  (rpegues@tripwire.com)
Responses Re: BUG #14038: substring cuts unicode char in half, allowing to save broken utf8 into table  (Reece Pegues <RPegues@tripwire.com>)
List pgsql-bugs
rpegues@tripwire.com writes:
> We have a table with an update trigger where if you modify a certain column,
> we change the name of the row by calling a function.
> In the function, substring() the name and then add a random string to that.
> However, the substring appears to cut a unicode character in half, and the
> update trigger then updates the name with the broken string.

That should not happen if Postgres knows it's dealing with unicode data.
What have you got the database's encoding set to?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #14033: cross-compilation to ARM fails
Next
From: Reece Pegues
Date:
Subject: Re: BUG #14038: substring cuts unicode char in half, allowing to save broken utf8 into table