Hi,

While working on a new client (just a hobby, won't be big and professional like 
node-postgres), I noticed a small error in a comment in src/common/saslprep.c.

The comment for non_ascii_space_ranges states that non-ASCII space characters 
are mapped to U+00A0:

> * These are all mapped to the ASCII space character (U+00A0).

However, the actual implementation maps them to 0x0020 (ASCII SPACE):

> if (IS_CODE_IN_TABLE(code, non_ascii_space_ranges))
>   input_chars[count++] = 0x0020;

The attached patch corrects the comment to refer to U+0020:

> - * These are all mapped to the ASCII space character (U+00A0).
> + * These are all mapped to the ASCII space character (U+0020).

The patch is against master and changes only a single bit in a comment, with no 
impact on functionality.

Best regards,
Robert I Nilsson
From b1d1b403dd09c146de384cd054f3e818b80a5142 Mon Sep 17 00:00:00 2001
From: Robert I Nilsson <[email protected]>
Date: Mon, 9 Nov 2026 09:29:06 +0100
Subject: [PATCH v1] Fix incorrect Unicode code point in SASLprep comment

The comment for non_ascii_space_ranges incorrectly states that
non-ASCII space characters are mapped to U+00A0. The implementation
actually maps them to U+0020 (ASCII SPACE).

Correct the comment to match the implementation.
---
 src/common/saslprep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/saslprep.c b/src/common/saslprep.c
index 38d50dd823c..a2bb60ac0cb 100644
--- a/src/common/saslprep.c
+++ b/src/common/saslprep.c
@@ -62,7 +62,7 @@ static int	pg_utf8_string_len(const char *source);
 /*
  * C.1.2 Non-ASCII space characters
  *
- * These are all mapped to the ASCII space character (U+00A0).
+ * These are all mapped to the ASCII space character (U+0020).
  */
 static const char32_t non_ascii_space_ranges[] =
 {
-- 
2.53.0

Reply via email to