From fdd5212284912b1176cafd0cf141832c9d5762f4 Mon Sep 17 00:00:00 2001 From: Jugu Dannie Sundar Date: Mon, 7 Aug 2017 21:27:46 +0000 Subject: [PATCH] ICU-10935 merging from branch X-SVN-Rev: 40316 --- icu4c/source/tools/genrb/wrtjava.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/icu4c/source/tools/genrb/wrtjava.cpp b/icu4c/source/tools/genrb/wrtjava.cpp index 02bcb6250a5..f1eb229760f 100644 --- a/icu4c/source/tools/genrb/wrtjava.cpp +++ b/icu4c/source/tools/genrb/wrtjava.cpp @@ -33,6 +33,7 @@ #include "uhash.h" #include "uresimp.h" #include "unicode/ustring.h" +#include "unicode/utf8.h" void res_write_java(struct SResource *res,UErrorCode *status); @@ -244,7 +245,8 @@ str_write_java(const UChar *src, int32_t srcLen, UBool printEndLine, UErrorCode memset(buf,0,length); bufLen = uCharsToChars(buf,length,src,srcLen,status); - + // buflen accounts for extra bytes added due to multi byte encoding of + // non ASCII characters if(printEndLine) write_tabs(out); @@ -284,10 +286,22 @@ str_write_java(const UChar *src, int32_t srcLen, UBool printEndLine, UErrorCode } } T_FileStream_write(out,"\"",1); + uint32_t byteIndex = 0; + uint32_t trailBytes = 0; if(len+addfLength; - if(srcLen>0 ) { byteArray = res->fData; -- 2.40.0