Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 08756105C9 for ; Wed, 2 Apr 2014 13:31:23 +0000 (UTC) Received: (qmail 74687 invoked by uid 500); 2 Apr 2014 13:31:22 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 74592 invoked by uid 500); 2 Apr 2014 13:31:19 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 74507 invoked by uid 99); 2 Apr 2014 13:31:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2014 13:31:17 +0000 Date: Wed, 2 Apr 2014 13:31:17 +0000 (UTC) From: "Ian Clelland (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (CB-6368) FileReader readAsBinaryString can't work in Android. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-6368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ian Clelland reassigned CB-6368: -------------------------------- Assignee: Ian Clelland > FileReader readAsBinaryString can't work in Android. > ---------------------------------------------------- > > Key: CB-6368 > URL: https://issues.apache.org/jira/browse/CB-6368 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin File > Affects Versions: 3.4.0 > Environment: Android 4.0.4 > Reporter: puchen > Assignee: Ian Clelland > > Run spec test, at spec.86 of 'Run File Tests', got error message > D/CordovaLog(7621): : Line 1 : Uncaught SyntaxError: Unexpected token ILLEGAL > E/Web Console(7621): Uncaught SyntaxError: Unexpected token ILLEGAL at :1 > Only Android > 1.Can't get the success callback. When cordova called 'public PluginResult(Status status, byte[] data, boolean binaryString) ' method, the bytes encoded to string, and assigned to 'encodedMessage'. Then cordova sent the pluginResult, and called pluginResult.getMessage() in encodeAsJsMessage method.So the problem appeared, the callback result is the String type but can't be JSONObject.quote. Then cordova called callbackFromNative method in cordova.js, the 'callback.success.apply' worked error, the Cordova Log showed 'Uncaught SyntaxError: Unexpected token ILLEGAL'. The reason is 'readAsBinaryString' returned a binary string but can't be quoted, caused the js layer syntax error. > 2.If we can get the success callback, but the result is not expected in spec.86, because 'Base64.encodeToString' can't return the correct result in PluginResult.java. -- This message was sent by Atlassian JIRA (v6.2#6252)