lib/util/charset/charconv: clarify comments in next_codepoint_convenience_ext()
authorMichael Adam <obnox@samba.org>
Sun, 31 Oct 2010 07:21:41 +0000 (08:21 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 3 Nov 2010 22:45:20 +0000 (22:45 +0000)
Give the unicod U+<hexnumber> notation of the codepoints
referred to in the comments. Also reformat the comments some.

lib/util/charset/charcnv.c

index 6cced15a527ce7149f693528c24c5a8ab341c2d4..f8aeea34b8bc5a0dc5049c02f734a791f70b536e 100644 (file)
@@ -406,9 +406,10 @@ _PUBLIC_ codepoint_t next_codepoint_convenience_ext(
                return (codepoint_t)str[0];
        }
 
-       /* we assume that no multi-byte character can take
-          more than 5 bytes. This is OK as we only
-          support codepoints up to 1M */
+       /*
+        * we assume that no multi-byte character can take more than 5 bytes.
+        * This is OK as we only support codepoints up to 1M (U+100000)
+        */
        ilen_orig = strnlen(str, 5);
        ilen = ilen_orig;
 
@@ -418,8 +419,10 @@ _PUBLIC_ codepoint_t next_codepoint_convenience_ext(
                return INVALID_CODEPOINT;
        }
 
-       /* this looks a little strange, but it is needed to cope
-          with codepoints above 64k */
+       /*
+        * this looks a little strange, but it is needed to cope with
+        * codepoints above 64k (U+1000) which are encoded as per RFC2781.
+        */
        olen = 2;
        outbuf = (char *)buf;
        smb_iconv(descriptor, &str, &ilen, &outbuf, &olen);