Date.toLocaleString() returns broken Kanji when called in preview()
WinXP+SP3(Japanese), Firefox:(JP)3.5.2/.3, Ubiq:0.5.4
In Japanese environment, Date.toLocaleString() returns Kanji-mixed string.
But when it's called in command's preview() function, or called for object-property's initialization, it returns 'broken' (unreadable) Kanji-chars.
String.charCodeAt() seems that it generates Shift-JIS encoded Kanji-chars, not Unicode.
In contrast, it returns correct Kanji-mixed string when called in command's execute() function (and of course it's okay when running on browser, as normal web script).
I also tried to replace scripts/date.js with Datejs ja-JP version (packed in Datejs-all-Alpha1.zip), then restarted Firefox, but nothing changed.
I'm not sure whether this behavior can be reproduced in other user's environment. Is it Ubiquity's defect, or is my environment's problem ?
In Japanese environment, Date.toLocaleString() returns Kanji-mixed string.
But when it's called in command's preview() function, or called for object-property's initialization, it returns 'broken' (unreadable) Kanji-chars.
String.charCodeAt() seems that it generates Shift-JIS encoded Kanji-chars, not Unicode.
In contrast, it returns correct Kanji-mixed string when called in command's execute() function (and of course it's okay when running on browser, as normal web script).
I also tried to replace scripts/date.js with Datejs ja-JP version (packed in Datejs-all-Alpha1.zip), then restarted Firefox, but nothing changed.
I'm not sure whether this behavior can be reproduced in other user's environment. Is it Ubiquity's defect, or is my environment's problem ?
CmdUtils.CreateCommand({
names: ["test"],
str: (new Date()).toLocaleString(), //NG:Kanji broken
preview: function(pblock) {
displayMessage( (new Date()).toLocaleString() ); //NG:Kanji broken
},
execute: function() {
displayMessage( (new Date()).toLocaleString() ); //OK:correct Kanji
}
});
1
person has this problem
I have this problem, too!
Tell me when someone solves it.
The more people who report this problem, the more it gets noticed.
The more people who report this problem, the more it gets noticed.
The company has acknowledged this problem.
-
1 person says
this solves the problem
-
Thanks a lot. I'll write private date-formatter to work around.
Loading Profile...




EMPLOYEE