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 3584E17FCB for ; Sat, 3 Oct 2015 21:18:27 +0000 (UTC) Received: (qmail 30232 invoked by uid 500); 3 Oct 2015 21:18:27 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 30202 invoked by uid 500); 3 Oct 2015 21:18:27 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 30083 invoked by uid 99); 3 Oct 2015 21:18:26 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Oct 2015 21:18:26 +0000 Date: Sat, 3 Oct 2015 21:18:26 +0000 (UTC) From: "Shazron Abdullah (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-9435) cordova-ios cannot handle Unicode U+2028 (line separator) or U+2029 (paragraph separator) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-9435?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:all-tabpanel ] Shazron Abdullah updated CB-9435: --------------------------------- Description:=20 In https://github.com/litehelpers/Cordova-sqlite-storage/issues/147 someone= reported that my sqlite plugin could not handle \u2028 characters on iOS, = and further testing on my part isolated this to the result callback message= . I made a version of cordova-ext-echo at https://github.com/brodybits/cord= ova-ext-echo-and-length that can be used to demonstrate this issue cordova-= ios. If I install the plugin from https://github.com/brodybits/cordova-ext-echo-= and-length and run the following code on the iOS version: {code} var Echo =3D cordova.require('org.apache.cordova.plugins.echo.Echo'= ); Echo.echo('first\u2027second', function(v) { console.log('cb 1: ' + v); }); Echo.echo('third\u2028fourth', function(v) { console.log('cb 2: ' + v); }); Echo.echo('fifth\u2029six', function(v) { console.log('cb 3: ' + v); }); Echo.len('first\u2027second', function(v) { console.log('len cb 1: ' + v); }); Echo.len('third\u2028fourth', function(v) { console.log('len cb 2: ' + v); }); Echo.len('fifth\u2029six', function(v) { console.log('len cb 3: ' + v); }); {code} I get the following result: {code} 2015-07-31 01:21:11.968 cijt[25760:18e03] cb 1: first=E2=80=A7second 2015-07-31 01:21:11.971 cijt[25760:18e03] len cb 1: 12 2015-07-31 01:21:11.973 cijt[25760:18e03] len cb 2: 12 2015-07-31 01:21:11.973 cijt[25760:18e03] len cb 3: 9 {code} We can see that we can send a string with U+2028 and U+2029 from Javascript= to Objective-C with no problems: if Objective-C calculates and returns the= length it works but if Objective-C tries to send the same string back to J= avascript it fails. I discovered the following article that seems to describe the cause: http:/= /timelessrepo.com/json-isnt-a-javascript-subset (Cordova does seem to handl= e the \u000A and \u000D characters OK.) When I ran the same test program on Android (with the same plugin installed= ), I get all of the callbacks ok (trace filtered by hand): {code} I/chromium(14744): [INFO:CONSOLE(173)] "cb 1: first=E2=80=A7second", source= : file:///android_asset/www/plugins/cordova-plugin-console/www/console-via-= logger.js (173) I/chromium(14744): [INFO:CONSOLE(173)] "cb 2: third=E2=80=A8fourth", source= : file:///android_asset/www/plugins/cordova-plugin-console/www/console-via-= logger.js (173) I/chromium(14744): [INFO:CONSOLE(173)] "cb 3: fifth=E2=80=A9six", source: f= ile:///android_asset/www/plugins/cordova-plugin-console/www/console-via-log= ger.js (173) I/chromium(14744): [INFO:CONSOLE(173)] "len cb 1: 12", source: file:///andr= oid_asset/www/plugins/cordova-plugin-console/www/console-via-logger.js (173= ) I/chromium(14744): [INFO:CONSOLE(173)] "len cb 2: 12", source: file:///andr= oid_asset/www/plugins/cordova-plugin-console/www/console-via-logger.js (173= ) I/chromium(14744): [INFO:CONSOLE(173)] "len cb 3: 9", source: file:///andro= id_asset/www/plugins/cordova-plugin-console/www/console-via-logger.js (173) {code} was: In https://github.com/litehelpers/Cordova-sqlite-storage/issues/147 someone= reported that my sqlite plugin could not handle \u2028 characters on iOS, = and further testing on my part isolated this to the result callback message= . I made a version of cordova-ext-echo at https://github.com/brodybits/cord= ova-ext-echo-and-length that can be used to demonstrate this issue cordova-= ios. If I install the plugin from https://github.com/brodybits/cordova-ext-echo-= and-length and run the following code on the iOS version: var Echo =3D cordova.require('org.apache.cordova.plugins.echo.Echo'= ); Echo.echo('first\u2027second', function(v) { console.log('cb 1: ' + v); }); Echo.echo('third\u2028fourth', function(v) { console.log('cb 2: ' + v); }); Echo.echo('fifth\u2029six', function(v) { console.log('cb 3: ' + v); }); Echo.len('first\u2027second', function(v) { console.log('len cb 1: ' + v); }); Echo.len('third\u2028fourth', function(v) { console.log('len cb 2: ' + v); }); Echo.len('fifth\u2029six', function(v) { console.log('len cb 3: ' + v); }); I get the following result: 2015-07-31 01:21:11.968 cijt[25760:18e03] cb 1: first=E2=80=A7second 2015-07-31 01:21:11.971 cijt[25760:18e03] len cb 1: 12 2015-07-31 01:21:11.973 cijt[25760:18e03] len cb 2: 12 2015-07-31 01:21:11.973 cijt[25760:18e03] len cb 3: 9 We can see that we can send a string with U+2028 and U+2029 from Javascript= to Objective-C with no problems: if Objective-C calculates and returns the= length it works but if Objective-C tries to send the same string back to J= avascript it fails. I discovered the following article that seems to describe the cause: http:/= /timelessrepo.com/json-isnt-a-javascript-subset (Cordova does seem to handl= e the \u000A and \u000D characters OK.) When I ran the same test program on Android (with the same plugin installed= ), I get all of the callbacks ok (trace filtered by hand): I/chromium(14744): [INFO:CONSOLE(173)] "cb 1: first=E2=80=A7second", source= : file:///android_asset/www/plugins/cordova-plugin-console/www/console-via-= logger.js (173) I/chromium(14744): [INFO:CONSOLE(173)] "cb 2: third=E2=80=A8fourth", source= : file:///android_asset/www/plugins/cordova-plugin-console/www/console-via-= logger.js (173) I/chromium(14744): [INFO:CONSOLE(173)] "cb 3: fifth=E2=80=A9six", source: f= ile:///android_asset/www/plugins/cordova-plugin-console/www/console-via-log= ger.js (173) I/chromium(14744): [INFO:CONSOLE(173)] "len cb 1: 12", source: file:///andr= oid_asset/www/plugins/cordova-plugin-console/www/console-via-logger.js (173= ) I/chromium(14744): [INFO:CONSOLE(173)] "len cb 2: 12", source: file:///andr= oid_asset/www/plugins/cordova-plugin-console/www/console-via-logger.js (173= ) I/chromium(14744): [INFO:CONSOLE(173)] "len cb 3: 9", source: file:///andro= id_asset/www/plugins/cordova-plugin-console/www/console-via-logger.js (173) > cordova-ios cannot handle Unicode U+2028 (line separator) or U+2029 (para= graph separator) > -------------------------------------------------------------------------= ---------------- > > Key: CB-9435 > URL: https://issues.apache.org/jira/browse/CB-9435 > Project: Apache Cordova > Issue Type: Bug > Components: iOS > Reporter: Chris Brody > Assignee: Jesse MacFadyen > Labels: cordova-ios-4.0.x > > In https://github.com/litehelpers/Cordova-sqlite-storage/issues/147 someo= ne reported that my sqlite plugin could not handle \u2028 characters on iOS= , and further testing on my part isolated this to the result callback messa= ge. I made a version of cordova-ext-echo at https://github.com/brodybits/co= rdova-ext-echo-and-length that can be used to demonstrate this issue cordov= a-ios. > If I install the plugin from https://github.com/brodybits/cordova-ext-ech= o-and-length and run the following code on the iOS version: > {code} > var Echo =3D cordova.require('org.apache.cordova.plugins.echo.Ech= o'); > Echo.echo('first\u2027second', function(v) { > console.log('cb 1: ' + v); > }); > Echo.echo('third\u2028fourth', function(v) { > console.log('cb 2: ' + v); > }); > Echo.echo('fifth\u2029six', function(v) { > console.log('cb 3: ' + v); > }); > Echo.len('first\u2027second', function(v) { > console.log('len cb 1: ' + v); > }); > Echo.len('third\u2028fourth', function(v) { > console.log('len cb 2: ' + v); > }); > Echo.len('fifth\u2029six', function(v) { > console.log('len cb 3: ' + v); > }); > {code} > I get the following result: > {code} > 2015-07-31 01:21:11.968 cijt[25760:18e03] cb 1: first=E2=80=A7second > 2015-07-31 01:21:11.971 cijt[25760:18e03] len cb 1: 12 > 2015-07-31 01:21:11.973 cijt[25760:18e03] len cb 2: 12 > 2015-07-31 01:21:11.973 cijt[25760:18e03] len cb 3: 9 > {code} > We can see that we can send a string with U+2028 and U+2029 from Javascri= pt to Objective-C with no problems: if Objective-C calculates and returns t= he length it works but if Objective-C tries to send the same string back to= Javascript it fails. > I discovered the following article that seems to describe the cause: http= ://timelessrepo.com/json-isnt-a-javascript-subset (Cordova does seem to han= dle the \u000A and \u000D characters OK.) > When I ran the same test program on Android (with the same plugin install= ed), I get all of the callbacks ok (trace filtered by hand): > {code} > I/chromium(14744): [INFO:CONSOLE(173)] "cb 1: first=E2=80=A7second", sour= ce: file:///android_asset/www/plugins/cordova-plugin-console/www/console-vi= a-logger.js (173) > I/chromium(14744): [INFO:CONSOLE(173)] "cb 2: third=E2=80=A8fourth", sour= ce: file:///android_asset/www/plugins/cordova-plugin-console/www/console-vi= a-logger.js (173) > I/chromium(14744): [INFO:CONSOLE(173)] "cb 3: fifth=E2=80=A9six", source:= file:///android_asset/www/plugins/cordova-plugin-console/www/console-via-l= ogger.js (173) > I/chromium(14744): [INFO:CONSOLE(173)] "len cb 1: 12", source: file:///an= droid_asset/www/plugins/cordova-plugin-console/www/console-via-logger.js (1= 73) > I/chromium(14744): [INFO:CONSOLE(173)] "len cb 2: 12", source: file:///an= droid_asset/www/plugins/cordova-plugin-console/www/console-via-logger.js (1= 73) > I/chromium(14744): [INFO:CONSOLE(173)] "len cb 3: 9", source: file:///and= roid_asset/www/plugins/cordova-plugin-console/www/console-via-logger.js (17= 3) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org