如何将查询字符串转换为希伯来字母

时间:2017-10-23 09:56:33

标签: angular unicode hebrew

我有这一行来从此网址http://localhost:4200/אבי获取查询字符串:

const path = location.path(true); // returns "%D7%90%D7%91%D7%99"

我可以将其转换回正常的希伯来字母(在这种情况下为אבי)吗?

1 个答案:

答案 0 :(得分:2)

您可以使用全局函数decodeURI



console.log(decodeURI("%D7%90%D7%91%D7%99"));




有一个对手,encodeURI反其道而行之:



console.log(encodeURI("אבי"));




相关问题