[ 
https://issues.apache.org/jira/browse/CB-10964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15232245#comment-15232245
 ] 

ASF GitHub Bot commented on CB-10964:
-------------------------------------

GitHub user daserge opened a pull request:

    https://github.com/apache/cordova-ios/pull/215

    CB-10964 Handle build.json file starting with a BOM

    [Jira issue](https://issues.apache.org/jira/browse/CB-10964)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-ios CB-10964

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-ios/pull/215.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #215
    
----
commit 4abbcb6e79c576911c76697c61041ff02c22eef1
Author: daserge <[email protected]>
Date:   2016-04-08T14:15:32Z

    CB-10964 Handle build.json file starting with a BOM

----


> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to