Status: New
Owner: ----
New issue 2404 by [email protected]: Asian characters are garbled when
string is replaced using RegExp('\\{'+i+'\\}', "g")
http://code.google.com/p/v8/issues/detail?id=2404
Detailed description of the issue.
I write a string format source code like:
String.prototype.format = function (){
var formatted = this;
for (var i = 0; i < arguments.length; i++) {
var regexp = new RegExp('\\{'+i+'\\}', 'g');
formatted = formatted.replace(regexp, arguments[i]);
}
return formatted;
}
The following source code is executed using V8:
"regular expression test: {0} is Chinese word".format("中国");
output string is garbled.
If using JavascriptCore, it works well.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev