开发者

NodeJS encodeURI produces wrong result for ß

开发者 https://www.devze.com 2023-03-26 18:20 出处:网络
I am using Javascript\'s encodeURI / encodeURIComponent to encode a string containing the german \"ß\"-letter.开发者_开发技巧

I am using Javascript's encodeURI / encodeURIComponent to encode a string containing the german "ß"-letter.

开发者_开发技巧

Unfortunately nodejs encodes ß as %EF%BF%BD and not like for example Firefox does: %C3%9F

thus the server i am trying to communicate with cannot give me correct results.

Is there an option for changing how encodeURI behaves? maybe some utf-problem or something?

Thanks.


It's interpreting it as an illegal character (\uFFFD) which in utf-8 is EF BF BD.

As I understand from a quick glance over this disscution http://groups.google.com/group/nodejs/browse_thread/thread/239f40df6036095d?pli=1 , there might be an issue with V8

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号