summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2022-05-24 14:11:38 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2022-05-24 14:11:38 +0000
commitb5c1cd20295430a4f10904899b38732729ae6af7 (patch)
tree4b885b7750adad33a8c9f5925e86930069d07bee
parentdcdd7daaef7ee6c077a4769a5bec1fbc11e5611f (diff)
downloadapr-b5c1cd20295430a4f10904899b38732729ae6af7.tar.gz
Normalize ucs-4 to utf-32 (documentation change)
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1901212 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--misc/win32/utf8.c6
-rw-r--r--test/internal/Makefile.win4
-rw-r--r--test/internal/testutf.c (renamed from test/internal/testucs.c)22
3 files changed, 16 insertions, 16 deletions
diff --git a/misc/win32/utf8.c b/misc/win32/utf8.c
index 76f40ea1e..cba5d4934 100644
--- a/misc/win32/utf8.c
+++ b/misc/win32/utf8.c
@@ -44,7 +44,7 @@
* One of the X bits must be 1 to avoid overlong representation in utf-8.
*
* For conversion into utf-16, the 4th form is limited in range to 0010 FFFF,
- * and the final two forms are used only by full ucs-4, per RFC 3629;
+ * and the final two forms are used only by full utf-32, per RFC 3629;
*
* "Pairs of UCS-2 values between D800 and DFFF (surrogate pairs in
* Unicode parlance), being actually UCS-4 characters transformed
@@ -110,7 +110,7 @@ APR_DECLARE(apr_status_t) apr_conv_utf8_to_utf16(const char *in,
expect = 1;
while ((ch & mask) == mask) {
mask |= mask >> 1;
- if (++expect > 3) /* (or 5 for a ucs-4 code point) */
+ if (++expect > 3) /* (or 5 for a utf-32 code point) */
return APR_EINVAL;
}
newch = ch & ~mask;
@@ -158,7 +158,7 @@ APR_DECLARE(apr_status_t) apr_conv_utf8_to_utf16(const char *in,
newch |= (ch & 0077);
}
*inbytes -= eating;
- /* newch is now a true ucs-4 character
+ /* newch is now a true utf-32 character
*
* now we need to fold to utf-16
*/
diff --git a/test/internal/Makefile.win b/test/internal/Makefile.win
index a881f0781..df64ee17c 100644
--- a/test/internal/Makefile.win
+++ b/test/internal/Makefile.win
@@ -42,7 +42,7 @@ INTDIR=$(OUTDIR)
!MESSAGE Building tests into $(OUTDIR) for $(MODEL)
NONPORTABLE = \
- $(OUTDIR)\testucs.exe
+ $(OUTDIR)\testutf.exe
CLEAN_BUILDDIRS = Release Debug 9x x64
@@ -85,7 +85,7 @@ SHLDFLAGS = /nologo /dll /debug /subsystem:windows /incremental:no
.c{$(INTDIR)}.obj:
$(CL) $(CFLAGS) -c $< -Fd$(INTDIR)\ $(INCLUDES)
-$(OUTDIR)\testucs.exe: $(INTDIR)\testucs.obj $(LOCAL_LIB)
+$(OUTDIR)\testutf.exe: $(INTDIR)\testutf.obj $(LOCAL_LIB)
$(LD) $(LDFLAGS) /out:"$@" $** $(LD_LIBS)
@if exist "$@.manifest" \
mt.exe -manifest "$@.manifest" -outputresource:$@;1
diff --git a/test/internal/testucs.c b/test/internal/testutf.c
index 786e240bc..ec89097ee 100644
--- a/test/internal/testucs.c
+++ b/test/internal/testutf.c
@@ -30,10 +30,10 @@ struct testval {
};
#ifdef FOR_REFERENCE
-/* For reference; a table of invalid utf-8 encoded ucs-2/ucs-4 sequences.
+/* For reference; a table of invalid utf-8 encoded utf-16/utf-32 sequences.
* The table consists of start, end pairs for all invalid ranges.
- * NO_UCS2_PAIRS will pass the reservered D800-DFFF values, halting at FFFF
- * FULL_UCS4_MAPPER represents all 31 bit values to 7FFF FFFF
+ * NO_UTF16_PAIRS will pass the reservered D800-DFFF values, halting at FFFF
+ * FULL_UTF32_MAPPER represents all 31 bit values to 7FFF FFFF
*
* We already tested these, because we ensure there is a 1:1 mapping across
* the entire range of byte values in each position of 1 to 6 byte sequences.
@@ -45,29 +45,29 @@ struct testval malformed[] = [
[[0xC1,0xBF], 2,], /* overshort mapping of 007F */
[[0xE0,0x80,0x80,], 3,], /* overshort mapping of 0000 */
[[0xE0,0x9F,0xBF,], 3,], /* overshort mapping of 07FF */
-#ifndef NO_UCS2_PAIRS
- [[0xED,0xA0,0x80,], 3,], /* unexpected mapping of UCS-2 literal D800 */
- [[0xED,0xBF,0xBF,], 3,], /* unexpected mapping of UCS-2 literal DFFF */
+#ifndef NO_UTF16_PAIRS
+ [[0xED,0xA0,0x80,], 3,], /* unexpected mapping of utf-16 literal D800 */
+ [[0xED,0xBF,0xBF,], 3,], /* unexpected mapping of utf-16 literal DFFF */
#endif
[[0xF0,0x80,0x80,0x80,], 4,], /* overshort mapping of 0000 */
[[0xF0,0x8F,0xBF,0xBF,], 4,], /* overshort mapping of FFFF */
-#ifdef NO_UCS2_PAIRS
+#ifdef NO_UTF16_PAIRS
[[0xF0,0x90,0x80,0x80,], 4,], /* invalid too large value 0001 0000 */
[[0xF4,0x8F,0xBF,0xBF,], 4,], /* invalid too large value 0010 FFFF */
#endif
-#ifndef FULL_UCS4_MAPPER
+#ifndef FULL_UTF32_MAPPER
[[0xF4,0x90,0x80,0x80,], 4,], /* invalid too large value 0011 0000 */
[[0xF7,0xBF,0xBF,0xBF,], 4,], /* invalid too large value 001F FFFF */
#endif
[[0xF8,0x80,0x80,0x80,0x80,], 5,], /* overshort mapping of 0000 0000 */
[[0xF8,0x87,0xBF,0xBF,0xBF,], 5,], /* overshort mapping of 001F FFFF */
-#ifndef FULL_UCS4_MAPPER
+#ifndef FULL_UTF32_MAPPER
[[0xF8,0x88,0x80,0x80,0x80,], 5,], /* invalid too large value 0020 0000 */
[[0xFB,0xBF,0xBF,0xBF,0xBF,], 5,], /* invalid too large value 03FF FFFF */
#endif
[[0xFC,0x80,0x80,0x80,0x80,0x80,], 6,], /* overshort mapping 0000 0000 */
[[0xFC,0x83,0xBF,0xBF,0xBF,0xBF,], 6,], /* overshort mapping 03FF FFFF */
-#ifndef FULL_UCS4_MAPPER
+#ifndef FULL_UTF32_MAPPER
[[0xFC,0x84,0x80,0x80,0x80,0x80,], 6,], /* overshort mapping 0400 0000 */
[[0xFD,0xBF,0xBF,0xBF,0xBF,0xBF,], 6,], /* overshort mapping 7FFF FFFF */
#endif
@@ -324,7 +324,7 @@ void test_ranges()
}
/*
- * Syntax: testucs [w|n]
+ * Syntax: testutf [w|n]
*
* If no arg or arg is not recognized, run equality sequence test.
*/