Skip to content

Commit

Permalink
Using UTF-8 as the default encoding rather than System.getProperty("f…
Browse files Browse the repository at this point in the history
…ile.encoding") [fixes #2528014].
  • Loading branch information
Adam Moore committed Mar 17, 2010
1 parent 6e67ea0 commit 1e10c35
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
13 changes: 9 additions & 4 deletions src/com/yahoo/platform/yui/compressor/YUICompressor.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,15 @@ public static void main(String args[]) {

String charset = (String) parser.getOptionValue(charsetOpt);
if (charset == null || !Charset.isSupported(charset)) {
charset = System.getProperty("file.encoding");
if (charset == null) {
charset = "UTF-8";
}
// charset = System.getProperty("file.encoding");
// if (charset == null) {
// charset = "UTF-8";
// }

// UTF-8 seems to be a better choice than what the system is reporting
charset = "UTF-8";


if (verbose) {
System.err.println("\n[INFO] Using charset " + charset);
}
Expand Down
11 changes: 1 addition & 10 deletions tests/_munge.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
(function() {
var w = window;

// logger
//
// var c = 1..toString();

w.hello = function(a, abc) {
// "a:nomunge"; // this useless statement causes a munging error
var xyz = "a:nomunge",
d = abc; // but it works fine like this



"a:nomunge";
w.alert("Hello, " + a);
};
})();
1 change: 1 addition & 0 deletions tests/_munge.js.min
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(function(){var a=window;a.hello=function(a,b){a.alert("Hello, "+a)}})();
1 change: 1 addition & 0 deletions tests/_string_combo.js.min
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function test(){var b="abc"};
1 change: 1 addition & 0 deletions tests/_syntax_error.js.min
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
window.$=$telerik.$;$(document).ready(function(){movePageElements();var a=$("textarea").val();if(a!=""){$("textarea").attr("style","display: block;")}else{$("textarea").attr("style","display: none;")}a=null});function movePageElements(){var e=null;var b=$(".pagecontrolscontainer");if(b.length>0){var e=b.attr("pagenumber");if((e>5)&&(e<28)){var a=$("div#commentbutton");$("div.buttonContainer").prepend(a)}else{$("div#commentbutton").attr("style","display: none;")}}if((e>5)&&(e<28)){var f=$(".dropshadow-top");var d=$("#dropshadow");var c=$(".dropshadow-bottom");$("#page").prepend(f);$("#topcontainer").after(d);d.append($("#topcontainer"));d.after(c)}e=null;b=null;f=null;d=null;c=null}function expandCollapseDiv(a){$telerik.$(a).slideToggle("slow")}function expandCollapseHelp(){$(".helpitems").slideToggle("slow");if($("#helpcontainer").length){$("#help-dropshadow-bot").insertAfter("#helpcontainer");$("#help-dropshadow-bot").removeAttr("style")}}function expandCollapseComments(){var a=$("textarea").attr("style");if(a=="display: none;"){$("textarea").fadeIn().focus()}else{$("textarea").fadeOut()}a=null};

0 comments on commit 1e10c35

Please sign in to comment.