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

标签 angular unicode hebrew

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

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

我可以将其转换回正常的希伯来语字母(在本例中是אבй)吗?

最佳答案

您可以使用全局函数decodeURI:

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

有一个对应的 encodeURI 来进行相反的操作:

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

关于angular - 如何将查询字符串转换为希伯来字母,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46886531/

相关文章:

angular - 如何获取具有id的特定文档数据? | AngularFire 5.1.1 | Cloud Firestore |文件资料

javascript - 使用 Observables 时处理服务器错误

c++ - 在 Windows 控制台应用程序中输出 unicode 字符串

javascript - 有没有办法强制 Node 使用 Unicode 字符的代理对(JSON 格式)写入文件?

iphone - iPhone 中从右到左的 UI(希伯来语)

ruby-on-rails-3 - 如何在 Ruby on Rails 3 中允许从右到左的语言

angular - Ionic Angular TypeError : architect_1. createBuilder 不是函数

css - Angular 应用程序中 (S)CSS 规则的顺序

Delphi Unicode 字符串长度(以字节为单位)

xml - raku 语法的标记不会命中文档的第一次出现,但会命中类似的后续出现