From fe3e7795b292a424e135574f8e2d581ebd9a65b9 Mon Sep 17 00:00:00 2001 From: Tom Robinson Date: Thu, 1 Apr 2010 23:39:14 -0700 Subject: [PATCH] Add charset attributes to all external script tags, including flatten. Fixes unicode bugs in flatten. --- CommonJS/bin/flatten | 7 ++++--- .../capp/Resources/Templates/Application/index-debug.html | 4 ++-- Tools/capp/Resources/Templates/Application/index.html | 4 ++-- .../Resources/Templates/NibApplication/index-debug.html | 4 ++-- Tools/capp/Resources/Templates/NibApplication/index.html | 4 ++-- .../Resources/Templates/ThemeDescriptor/index-debug.html | 4 ++-- Tools/capp/Resources/Templates/ThemeDescriptor/index.html | 4 ++-- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/CommonJS/bin/flatten b/CommonJS/bin/flatten index 0068fee00..20a0b2d65 100755 --- a/CommonJS/bin/flatten +++ b/CommonJS/bin/flatten @@ -181,6 +181,7 @@ ObjectiveJFlattener.prototype.buildApplicationJS = function() { buffers[0].push("for (var i = 1; i <= appFilesCount; i++) {"); buffers[0].push(" var script = document.createElement(\"script\");"); buffers[0].push(" script.src = \"Application\"+i+\".js\";"); + buffers[0].push(" script.charset = \"UTF-8\";"); buffers[0].push(" script.onload = function() { if (--appFilesCount === 0) ObjectiveJ.bootstrap(); };"); buffers[0].push(" document.getElementsByTagName(\"head\")[0].appendChild(script);"); buffers[0].push("}"); @@ -303,10 +304,10 @@ var scriptTagsBefore = '$1'; var scriptTagsAfter = - '$1'; + '$1'; // enable CPLog: -// scriptTagsAfter = '$1\n' + scriptTagsAfter; +// scriptTagsAfter = '$1\n' + scriptTagsAfter; function rewriteMainHTML(indexHTMLPath) { if (indexHTMLPath.isFile()) { @@ -318,7 +319,7 @@ function rewriteMainHTML(indexHTMLPath) { // escape any dollar signs by replacing them with two // then indent by splitting/joining on newlines scriptTagsAfter = - '$1'; } diff --git a/Tools/capp/Resources/Templates/Application/index-debug.html b/Tools/capp/Resources/Templates/Application/index-debug.html index a0e57f42c..d1a146427 100644 --- a/Tools/capp/Resources/Templates/Application/index-debug.html +++ b/Tools/capp/Resources/Templates/Application/index-debug.html @@ -20,7 +20,7 @@ OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"]; - + - +