mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 09:49:19 +02:00
support for utf8-encoded zip entry names
This commit is contained in:
parent
b512d3505f
commit
4e4e780f03
2 changed files with 39 additions and 7 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <ZLFile.h>
|
||||
#include <FileEncryptionInfo.h>
|
||||
#include <ZLFileImage.h>
|
||||
#include <ZLUnicodeUtil.h>
|
||||
|
||||
#include "AndroidUtil.h"
|
||||
#include "JniEnvelope.h"
|
||||
|
@ -288,13 +289,13 @@ jstring AndroidUtil::createJavaString(JNIEnv* env, const std::string &str) {
|
|||
}
|
||||
|
||||
std::string AndroidUtil::convertNonUtfString(const std::string &str) {
|
||||
const int len = str.length();
|
||||
if (len == 0) {
|
||||
if (ZLUnicodeUtil::isUtf8String(str)) {
|
||||
return str;
|
||||
}
|
||||
|
||||
JNIEnv *env = getEnv();
|
||||
|
||||
const int len = str.length();
|
||||
jchar *chars = new jchar[len];
|
||||
for (int i = 0; i < len; ++i) {
|
||||
chars[i] = (unsigned char)str[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue