On 2019-Sep-22, Juan José Santamaría Flecha wrote: > The attached patch addresses the comment about assuming UTF8.
The UTF8 bits looks reasonable to me. I guess the other part of that question is whether we support any other multibyte encoding that supports combining characters. Maybe for cases other than UTF8 we can test for 0-width chars (using pg_encoding_dsplen() perhaps?) and drive the upper/lower decision off that? (For the UTF8 case, I don't know if Juanjo's proposal is better than pg_encoding_dsplen. Both seem to boil down to a bsearch, though unicode_norm.c's table seems much larger than wchar.c's). -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services