X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/f3c0d7a59d99c2a94c6b8822291f0e42be3773c9..a01113dcd0f39d5da295ef82785beff9ed86fe38:/icuSources/tools/genrb/wrtjava.cpp diff --git a/icuSources/tools/genrb/wrtjava.cpp b/icuSources/tools/genrb/wrtjava.cpp index 02bcb625..f1eb2297 100644 --- a/icuSources/tools/genrb/wrtjava.cpp +++ b/icuSources/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;