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 93C5819996 for ; Fri, 8 Apr 2016 14:59:26 +0000 (UTC) Received: (qmail 21118 invoked by uid 500); 8 Apr 2016 14:59:26 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 20893 invoked by uid 500); 8 Apr 2016 14:59:25 -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 20363 invoked by uid 99); 8 Apr 2016 14:59:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2016 14:59:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9AD702C1F6E for ; Fri, 8 Apr 2016 14:59:25 +0000 (UTC) Date: Fri, 8 Apr 2016 14:59:25 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-10964) Handle build.json file starting with a BOM 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-10964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15232291#comment-15232291 ] ASF GitHub Bot commented on CB-10964: ------------------------------------- Github user omefire commented on the pull request: https://github.com/apache/cordova-ios/pull/215#issuecomment-207467649 Do we have corresponding PRs for other platforms ? (i.e: Android & Windows) > Handle build.json file starting with a BOM > ------------------------------------------ > > Key: CB-10964 > URL: https://issues.apache.org/jira/browse/CB-10964 > Project: Apache Cordova > Issue Type: Bug > Components: Android, iOS, Windows > Affects Versions: 3.5.0 > Environment: All development platforms > Reporter: Shuqian Ying > Assignee: Sergey Shakhnazarov > Priority: Minor > > The generated build.js file under the "platforms\android\cordova\lib" directory of a project throws exceptions when reading the utf-8 encoded build.json file under the root directory of the same project that starts with a byte order mark (BOM), due to a bug/feature of the Javascript JSON.parse method. Such kind of files are normally generated in automated build systems, like ours. > The solution we found is to strip that mark before parsing, namely, inside of the function "parseOpts", use the following line > .... > var config = JSON.parse(buildjson.replace(/^\uFEFF/, '')); > ... > instead of > .... > var config = JSON.parse(buildjson); > ... > This has always been a problem up to the most recent stable version (3.5.0) and most likely to cause the same problem for other platforms, besides android. -- 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