[英]angularjs issue with special character `®`
I have an expression in angularjs to replace special character Registered with surrounding sup tags. 我在angularjs中有一个表达式来替换周围注册代码中的特殊字符。
replace(/®/gi, '<sup>®</sup>')
But in the developer tools, it is changing the ® to a symbol (a question mark symbol) 但是在开发人员工具中,它将®更改为符号``(问号符号)
.replace(/�/gi, '<sup>®</sup>');
Not sure if the issue is with the angularjs header content-type. 不知道问题是否出在angularjs标头的内容类型上。 Please help!
请帮忙!
Thanks. 谢谢。
Use .replace(/\®/gi, '<sup>®</sup>')
使用
.replace(/\®/gi, '<sup>®</sup>')
Because \®
= ® 因为
\®
=®
For more information, 欲获得更多信息,
var x = "\®" var y = x.replace(/\®/gi, '<sup>®</sup>') console.log("x=",x); console.log("y=",y); var x1 = '®'; var y1 = x.replace(/\®/gi, '<sup>®</sup>') console.log("x1=",x1); console.log("x1= Ox00%s",x1.charCodeAt(0).toString(16)); console.log("y1=",y1);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.