summaryrefslogtreecommitdiff
path: root/src/common/unicode
diff options
context:
space:
mode:
authorJohn Naylor <john.naylor@postgresql.org>2021-08-20 11:10:17 -0400
committerJohn Naylor <john.naylor@postgresql.org>2021-08-25 13:08:11 -0400
commit78ab944cd4b9977732becd9d0bc83223b88af9a2 (patch)
tree465e9d0774be9df806ea03640f5637bbea9eefb3 /src/common/unicode
parenteb0d0d2c7300c9c5c22b35975c11265aa4becc84 (diff)
downloadpostgresql-78ab944cd4b9977732becd9d0bc83223b88af9a2.tar.gz
Change mbbisearch to return the character range
Add a width field to mbinterval and have mbbisearch return a pointer to the found range rather than just bool for success. A future commit will add another width besides zero, and this will allow that to use the same search. Reviewed by Jacob Champion Discussion: https://www.postgresql.org/message-id/CAFBsxsGOCpzV7c-f3a8ADsA1n4uZ%3D8puCctQp%2Bx7W0vgkv%3Dw%2Bg%40mail.gmail.com
Diffstat (limited to 'src/common/unicode')
-rw-r--r--src/common/unicode/generate-unicode_width_table.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/unicode/generate-unicode_width_table.pl b/src/common/unicode/generate-unicode_width_table.pl
index 90b57af075..0cf44b029c 100644
--- a/src/common/unicode/generate-unicode_width_table.pl
+++ b/src/common/unicode/generate-unicode_width_table.pl
@@ -17,7 +17,7 @@ my $count = 0;
print
"/* generated by src/common/unicode/generate-unicode_width_table.pl, do not edit */\n\n";
-print "static const struct mbinterval combining[] = {\n";
+print "static const struct mbinterval wcwidth[] = {\n";
foreach my $line (<ARGV>)
{
@@ -40,7 +40,7 @@ foreach my $line (<ARGV>)
# not a combining character, print out previous range if any
if (defined($range_start))
{
- printf "\t{0x%04X, 0x%04X},\n", $range_start, $prev_codepoint;
+ printf "\t{0x%04X, 0x%04X, 0},\n", $range_start, $prev_codepoint;
$range_start = undef;
}
}