Repository: cordova-ios Updated Branches: refs/heads/master b7e3be104 -> 787bce0f8
CB-6992 Fix non-working create case, add new test This closes #216 Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/787bce0f Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/787bce0f Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/787bce0f Branch: refs/heads/master Commit: 787bce0f8d028e409660d54aad50ec2434ef43a4 Parents: b7e3be1 Author: Tony Homer <tony.ho...@intel.com> Authored: Mon Apr 11 16:27:59 2016 -0400 Committer: Vladimir Kotikov <v-vlk...@microsoft.com> Committed: Wed Apr 13 11:41:08 2016 +0300 ---------------------------------------------------------------------- bin/templates/scripts/cordova/Api.js | 8 +++++++- tests/spec/create.spec.js | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/787bce0f/bin/templates/scripts/cordova/Api.js ---------------------------------------------------------------------- diff --git a/bin/templates/scripts/cordova/Api.js b/bin/templates/scripts/cordova/Api.js index a51d93b..f926b57 100644 --- a/bin/templates/scripts/cordova/Api.js +++ b/bin/templates/scripts/cordova/Api.js @@ -21,6 +21,7 @@ var fs = require('fs'); var path = require('path'); +var unorm = require('unorm'); var CordovaError = require('cordova-common').CordovaError; var CordovaLogger = require('cordova-common').CordovaLogger; @@ -108,8 +109,13 @@ function Api(platform, platformRootDir, events) { Api.createPlatform = function (destination, config, options, events) { setupEvents(events); + // CB-6992 it is necessary to normalize characters + // because node and shell scripts handles unicode symbols differently + // We need to normalize the name to NFD form since iOS uses NFD unicode form + var name = unorm.nfd(config.name()); + return require('../../../lib/create') - .createProject(destination, config.packageName(), config.name(), options) + .createProject(destination, config.packageName(), name, options) .then(function () { // after platform is created we return Api instance based on new Api.js location // This is required to correctly resolve paths in the future api calls http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/787bce0f/tests/spec/create.spec.js ---------------------------------------------------------------------- diff --git a/tests/spec/create.spec.js b/tests/spec/create.spec.js index 39f80c2..7b652de 100644 --- a/tests/spec/create.spec.js +++ b/tests/spec/create.spec.js @@ -74,6 +74,13 @@ describe('create', function() { createAndBuild(projectname, projectid); }); + it('create project with unicode name 2, no spaces', function() { + var projectname = 'إثرا'; + var projectid = 'com.test.app3.2'; + + createAndBuild(projectname, projectid); + }); + it('create project with unicode name, and spaces', function() { var projectname = 'å¿å¿å¿å¿ ç¨ç¨ç¨ç¨'; var projectid = 'com.test.app4'; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org