summaryrefslogtreecommitdiff
path: root/src/modules/filters/utf8nfc.cpp
diff options
context:
space:
mode:
authorDaniel Glassey <wdg@debian.org>2015-09-07 11:14:57 +0100
committerDaniel Glassey <wdg@debian.org>2015-09-07 11:14:57 +0100
commit7b6c8b08e9d29332dcd0a1029e7421334bfb6f61 (patch)
treedc263ee8b6c923716a8e0fed64756b7af1238dc7 /src/modules/filters/utf8nfc.cpp
parent7a00574163029c0c2b649878c95d5acbd083564a (diff)
Imported Upstream version 1.7.3+dfsg
Diffstat (limited to 'src/modules/filters/utf8nfc.cpp')
-rw-r--r--src/modules/filters/utf8nfc.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/modules/filters/utf8nfc.cpp b/src/modules/filters/utf8nfc.cpp
index 49f12bb..06bd76f 100644
--- a/src/modules/filters/utf8nfc.cpp
+++ b/src/modules/filters/utf8nfc.cpp
@@ -3,7 +3,7 @@
* utf8nfc.cpp - SWFilter descendant to perform NFC (canonical
* composition normalization) on UTF-8 text
*
- * $Id: utf8nfc.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: utf8nfc.cpp 3157 2014-04-17 03:56:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -23,9 +23,6 @@
#ifdef _ICU_
-#include <stdlib.h>
-
-#include <utilstr.h>
#include <unicode/unistr.h>
#include <unicode/normlzr.h>
#include <unicode/unorm.h>
@@ -48,16 +45,16 @@ char UTF8NFC::processText(SWBuf &text, const SWKey *key, const SWModule *module)
if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
return -1;
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString source(text.getRawData(), text.length(), conv, status);
+ err = U_ZERO_ERROR;
+ UnicodeString source(text.getRawData(), text.length(), conv, err);
UnicodeString target;
- status = U_ZERO_ERROR;
- Normalizer::normalize(source, UNORM_NFC, 0, target, status);
+ err = U_ZERO_ERROR;
+ Normalizer::normalize(source, UNORM_NFC, 0, target, err);
- status = U_ZERO_ERROR;
+ err = U_ZERO_ERROR;
text.setSize(text.size()*2); // potentially, it can grow to 2x the original size
- int32_t len = target.extract(text.getRawData(), text.size(), conv, status);
+ int32_t len = target.extract(text.getRawData(), text.size(), conv, err);
text.setSize(len);
return 0;