diff options
author | Victoria Lease <violets@google.com> | 2012-05-24 11:45:35 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-24 11:45:35 -0700 |
commit | c8d518ba99824a76fa842162ea8284a2261fa4a0 (patch) | |
tree | bd995561157abd2c2327c27a263ee3e98270d63a | |
parent | 39ba1a3a160e41f7e3efc87365c14142f02a341a (diff) | |
parent | 62d3ac39c19a7b4160a180140ac8f1685c0df19a (diff) | |
download | external_webkit-c8d518ba99824a76fa842162ea8284a2261fa4a0.zip external_webkit-c8d518ba99824a76fa842162ea8284a2261fa4a0.tar.gz external_webkit-c8d518ba99824a76fa842162ea8284a2261fa4a0.tar.bz2 |
Merge "properly convert data from utf-16 to utf-8 in LoadData()" into jb-dev
-rw-r--r-- | Source/WebKit/android/jni/WebCoreFrameBridge.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp index af582fa..829c21c 100644 --- a/Source/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/Source/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -1290,12 +1290,12 @@ static void LoadData(JNIEnv *env, jobject obj, jstring baseUrl, jstring data, WebCore::ResourceRequest request(jstringToWtfString(env, baseUrl)); // Setup the substituteData - const char* dataStr = env->GetStringUTFChars(data, NULL); + WTF::CString cData = jstringToWtfString(env, data).utf8(); + const char* dataStr = cData.data(); WTF::RefPtr<WebCore::SharedBuffer> sharedBuffer = WebCore::SharedBuffer::create(); ALOG_ASSERT(dataStr, "nativeLoadData has a null data string."); - sharedBuffer->append(dataStr, strlen(dataStr)); - env->ReleaseStringUTFChars(data, dataStr); + sharedBuffer->append(dataStr, strlen(dataStr)); // copy dataStr WebCore::SubstituteData substituteData(sharedBuffer, jstringToWtfString(env, mimeType), jstringToWtfString(env, encoding), |