summaryrefslogtreecommitdiff
path: root/sal/textenc/convertisciidevangari.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sal/textenc/convertisciidevangari.cxx')
-rw-r--r--sal/textenc/convertisciidevangari.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/sal/textenc/convertisciidevangari.cxx b/sal/textenc/convertisciidevangari.cxx
index 9e6583119252..b8566ed6a51e 100644
--- a/sal/textenc/convertisciidevangari.cxx
+++ b/sal/textenc/convertisciidevangari.cxx
@@ -7,10 +7,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <sal/config.h>
+
+#include <cassert>
+
#include "converter.hxx"
#include "unichars.hxx"
#include "convertisciidevangari.hxx"
#include "convertsinglebytetobmpunicode.hxx"
+
+#include <rtl/character.hxx>
#include <rtl/textcvt.h>
using namespace sal::detail::textenc;
@@ -261,6 +267,11 @@ sal_Size UnicodeToIsciiDevanagari::convert(sal_Unicode const* pSrcBuf, sal_Size
cHighSurrogate = static_cast< sal_Unicode >(c);
continue;
}
+ else if (ImplIsLowSurrogate(c))
+ {
+ bUndefined = false;
+ goto bad_input;
+ }
}
else if (ImplIsLowSurrogate(c))
{
@@ -271,11 +282,7 @@ sal_Size UnicodeToIsciiDevanagari::convert(sal_Unicode const* pSrcBuf, sal_Size
bUndefined = false;
goto bad_input;
}
- if (ImplIsLowSurrogate(c) || ImplIsNoncharacter(c))
- {
- bUndefined = false;
- goto bad_input;
- }
+ assert(rtl::isUnicodeScalarValue(c));
//halant + halant E8 E8 -> halant + ZWNJ 094D 200C
//halant + nukta E8 E9 halant + ZWJ 094D 200D