diff options
author | Victoria Lease <violets@google.com> | 2012-05-24 11:47:47 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-05-24 11:47:47 -0700 |
commit | 284e9feef00d472eef6a2eb5757c85df23dd921a (patch) | |
tree | bd995561157abd2c2327c27a263ee3e98270d63a /Source/WebKit/android | |
parent | f285f8bed292bdc595396e8211705e867e015116 (diff) | |
parent | c8d518ba99824a76fa842162ea8284a2261fa4a0 (diff) | |
download | external_webkit-284e9feef00d472eef6a2eb5757c85df23dd921a.zip external_webkit-284e9feef00d472eef6a2eb5757c85df23dd921a.tar.gz external_webkit-284e9feef00d472eef6a2eb5757c85df23dd921a.tar.bz2 |
am c8d518ba: Merge "properly convert data from utf-16 to utf-8 in LoadData()" into jb-dev
* commit 'c8d518ba99824a76fa842162ea8284a2261fa4a0':
properly convert data from utf-16 to utf-8 in LoadData()
Diffstat (limited to 'Source/WebKit/android')
-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), |