mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Issue #80: Unable to open large json files on android 2.2 + phonegap 0.9.5
I could not get rid of the url encoding and decoding without hampering some users ability to pass non-ascii characters back to JavaScript. However, I was able to reduce the amount of data being passed from Java to JavaScript by 40% by decoding common characters that occur in JSON and XML. These characters will survive the round trip just fine and don't need to be encoded. This is the best solution I could come up with. You won't be able to read files as large as you could in 0.9.4 but it will get close and it will support non-ascii characters.
This commit is contained in:
@@ -767,8 +767,8 @@ PhoneGap.JSCallback = function() {
|
||||
// If callback has JavaScript statement to execute
|
||||
if (xmlhttp.status === 200) {
|
||||
|
||||
// Need to url decode the response and replace %20 with a space
|
||||
var msg = decodeURIComponent(xmlhttp.responseText.replace(/\+/g, '%20'));
|
||||
// Need to url decode the response
|
||||
var msg = decodeURIComponent(xmlhttp.responseText);
|
||||
setTimeout(function() {
|
||||
try {
|
||||
var t = eval(msg);
|
||||
|
||||
Reference in New Issue
Block a user