Move UTF8.h to UnicodeMapFuncs.h and rename UCS2 to UTF16
UTF8.h is not exclusively UTF-8 code. Renaming to UnicodeMapFuncs.h
identifies the file as containing maps for UnicodeMap and is
consistent with the name UnicodeMapTables.h.
The mapUCS2 code was changed to support UTF-16 in 979ef1ca without
changing the name.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f181fde..3a34168 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -610,6 +610,7 @@
poppler/StructElement.h
poppler/StructTreeRoot.h
poppler/UnicodeMap.h
+ poppler/UnicodeMapFuncs.h
poppler/UnicodeMapTables.h
poppler/UnicodeTypeTable.h
poppler/UnicodeCClassTables.h
@@ -627,7 +628,6 @@
poppler/StdinCachedFile.h
poppler/StdinPDFDocBuilder.h
poppler/UTF.h
- poppler/UTF8.h
poppler/XpdfPluginAPI.h
poppler/Sound.h
${CMAKE_CURRENT_BINARY_DIR}/poppler/poppler-config.h
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 2666993..09ad37a 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -110,7 +110,7 @@
#include "NameToUnicodeTable.h"
#include "UnicodeMapTables.h"
-#include "UTF8.h"
+#include "UnicodeMapFuncs.h"
#ifdef ENABLE_PLUGINS
# ifdef _WIN32
@@ -629,7 +629,7 @@
residentUnicodeMaps->add(map->getEncodingName(), map);
map = new UnicodeMap("UTF-8", gTrue, &mapUTF8);
residentUnicodeMaps->add(map->getEncodingName(), map);
- map = new UnicodeMap("UCS-2", gTrue, &mapUCS2);
+ map = new UnicodeMap("UTF-16", gTrue, &mapUTF16);
residentUnicodeMaps->add(map->getEncodingName(), map);
scanEncodingDirs();
diff --git a/poppler/UTF8.h b/poppler/UnicodeMapFuncs.h
similarity index 94%
rename from poppler/UTF8.h
rename to poppler/UnicodeMapFuncs.h
index 34a07d4..25c21c4 100644
--- a/poppler/UTF8.h
+++ b/poppler/UnicodeMapFuncs.h
@@ -1,6 +1,6 @@
//========================================================================
//
-// UTF8.h
+// UnicodeMapFuncs.h
//
// Copyright 2001-2003 Glyph & Cog, LLC
//
@@ -21,7 +21,7 @@
//========================================================================
static int mapUTF8(Unicode u, char *buf, int bufSize) {
- if (u <= 0x0000007f) {
+ if (u <= 0x0000007f) {
if (bufSize < 1) {
return 0;
}
@@ -56,7 +56,7 @@
}
}
-static int mapUCS2(Unicode u, char *buf, int bufSize) {
+static int mapUTF16(Unicode u, char *buf, int bufSize) {
if (u <= 0xffff) {
if (bufSize < 2) {
return 0;