X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/2ca993e82fb37b597a3c73ecd1586a139a6579c5..4f1e1a09ce4daed860e35d359ce2fceccb0764e8:/icuSources/tools/genrb/wrtjava.cpp diff --git a/icuSources/tools/genrb/wrtjava.cpp b/icuSources/tools/genrb/wrtjava.cpp index 1788c837..f1eb2297 100644 --- a/icuSources/tools/genrb/wrtjava.cpp +++ b/icuSources/tools/genrb/wrtjava.cpp @@ -1,3 +1,5 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* * @@ -31,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); @@ -242,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); @@ -282,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;