From: <rb...@us...> - 2014-01-05 12:58:41
|
Revision: 8951 http://sourceforge.net/p/htmlunit/code/8951 Author: rbri Date: 2014-01-05 12:58:37 +0000 (Sun, 05 Jan 2014) Log Message: ----------- finally fix the additional chars Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/DateCustom.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeDateTest.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/DateCustom.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/DateCustom.java 2014-01-04 15:25:08 UTC (rev 8950) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/DateCustom.java 2014-01-05 12:58:37 UTC (rev 8951) @@ -64,7 +64,7 @@ if (browserVersion.hasFeature(JS_DATE_LOCALE_DATE_SHORT_WITH_SPECIAL_CHARS)) { // [U+200E] -> Unicode Character 'LEFT-TO-RIGHT MARK' - formatString = "\u200Edd.MM.yyyy"; + formatString = "\u200Edd\u200E.\u200EMM\u200E.\u200Eyyyy"; } else if (browserVersion.hasFeature(JS_DATE_LOCALE_DATE_SHORT)) { formatString = "d.M.yyyy"; @@ -91,7 +91,8 @@ ((Window) thisObj.getParentScope()).getWebWindow().getWebClient().getBrowserVersion(); if (browserVersion.hasFeature(JS_DATE_LOCALE_TIME_WITH_SPECIAL_CHARS)) { - formatString = "HH:mm:ss"; + // [U+200E] -> Unicode Character 'LEFT-TO-RIGHT MARK' + formatString = "\u200EHH\u200E:\u200Emm\u200E:\u200Ess"; } else { formatString = "HH:mm:ss"; Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeDateTest.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeDateTest.java 2014-01-04 15:25:08 UTC (rev 8950) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/NativeDateTest.java 2014-01-05 12:58:37 UTC (rev 8951) @@ -139,7 +139,7 @@ @Test @Alerts(DEFAULT = "Saturday, January 01, 2000", CHROME = "1.1.2000", - IE11 = "\u200E01.01.2000") + IE11 = "\u200E01\u200E.\u200E01\u200E.\u200E2000") public void toLocaleDateString() throws Exception { final String html = "<html><head><title>foo</title><script>\n" @@ -149,7 +149,6 @@ + "</script></head><body onload='test()'>\n" + "</body></html>"; - System.out.println((int) getExpectedAlerts()[0].charAt(0)); loadPageWithAlerts2(html); } @@ -244,9 +243,7 @@ */ @Test @Alerts(DEFAULT = { "00:00:00", "07:08:09" }, - IE11 = { "00:00:00", "07:08:09" }) - // ATTENTION! the IE11 expectation only looks identical to the default one but there are invisible control - // characters (char code 14 - shift out) surrounding the digit pairs... + IE11 = { "\u200E00\u200E:\u200E00\u200E:\u200E00", "\u200E07\u200E:\u200E08\u200E:\u200E09" }) public void toLocaleTimeString() throws Exception { final String html = "<html><head><title>foo</title><script>\n" |