cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse MacFadyen (JIRA)" <>
Subject [jira] [Commented] (CB-5477) cordova CLI can't create WP8 project with encode issue!
Date Fri, 17 Jan 2014 23:32:19 GMT


Jesse MacFadyen commented on CB-5477:


I could not recreate this on my system.

Can you attempt to create a project using the wp8 project scripts directly?
c:\Repos\cordova\wp8\wp8\bin>create C:\Test\TestCreate333
The above produces this output on my machine:

platformRoot = c:\Repos\cordova\wp8\wp8
repoRoot = c:\Repos\cordova\wp8
Creating Cordova-WP8 Project:
        App Name : CordovaWP8AppProj
        Namespace : Cordova.Example
        Path : C:\Test\TestCreate333
CREATE SUCCESS : C:\Test\TestCreate333

I assume that your default encoding is unicode, and mine is ascii, so I have a patch that
you can try, assuming the above command fails on your system.
The patched branch can be found here:

Let me know if this works for you and I will merge it into master.

> cordova CLI can't create WP8 project with encode issue!
> -------------------------------------------------------
>                 Key: CB-5477
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI, WP8
>         Environment: win8(simple chinese)+vs2012+wp8sdk
>            Reporter: puchen
>            Assignee: Jesse MacFadyen
>            Priority: Critical
>             Fix For: 3.4.0
> descrip:
> C:\Windows\system32>cordova -v
> 3.2.0-0.1.0
> cordova create hello com.example.hello HelloWorld
> cd hello
> cordova platform add wp8
> got errors:
> D:\VSProject\helloCordova>cordova platform add wp8
> Checking wp8 requirements...
> Creating wp8 project...
> [Error: Non-whitespace before first tag.
> Line: 0
> Column: 1
> Char: �]
> Finally I found following files
> wmappmanifest.xml, HelloCordova.csproj, HelloCordova.sln, MainPage.xaml.cs, etc
> were corrupt, the start characters of file content were sth like
> 锘?*
> the cli can't parse these files
> I think it's an encoding issue
> here is sample issue
> my opinion:
> i check the corodova cli source code, i found it's this file ".cordova\lib\wp\cordova\3.2.0\wp8\bin\create.js"
caused this error!
> in create.js file:
> function write(filename, contents) {
>     var f=fso.OpenTextFile(filename, ForWriting, TristateTrue);
>     f.Write(contents);
>     f.Close();
> }
> WScript OpenTextFile Method :
> OpenTextFile Method  have 4 args but
> fso.OpenTextFile miss a args create,  
> OpenTextFile should open file with "unicode" encode,because cordova wp8 cli template
project files are encode with "utf-8". if we not specified encode OpenTextFile  should use
system default encode ascii.
> cordova template files were encoded with utf8, opentext and wirte with ascii, then save
thems  will cause  encode issue!

This message was sent by Atlassian JIRA

View raw message