gpt4 book ai didi

javascript - 如何将 "\\u00e2"或 "\\u00ea"等字符解码为 un​​icode 字符?

转载 作者:可可西里 更新时间:2023-11-01 13:19:49 26 4
gpt4 key购买 nike

<分区>

我正在使用 ASP.NET Core 并尝试获取 Twitter 的用户配置文件。服务器返回了如下响应文本:

"{\"id\":3278814606,\"id_str\":\"3278814606\",\"name\":\"T\u00e2n Nguy\u00ea\u0303n\",\"screen_name\":\"_ntnguyen\",\"location\":\"\",\"description\":\"\",\"url\":null,\"entities\":{\"description\":{\"urls\":[]}},\"protected\":false,\"followers_count\":1,\"friends_count\":39,\"listed_count\":0,\"created_at\":\"Mon Jul 13 20:32:53 +0000 2015\",\"favourites_count\":0,\"utc_offset\":null,\"time_zone\":null,\"geo_enabled\":false,\"verified\":false,\"statuses_count\":0,\"lang\":\"en\",\"contributors_enabled\":false,\"is_translator\":false,\"is_translation_enabled\":false,\"profile_background_color\":\"C0DEED\",\"profile_background_image_url\":\"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png\",\"profile_background_image_url_https\":\"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png\",\"profile_background_tile\":false,\"profile_image_url\":\"http:\/\/pbs.twimg.com\/profile_images\/1058043873358827521\/YOOYwQY5_normal.jpg\",\"profile_image_url_https\":\"https:\/\/pbs.twimg.com\/profile_images\/1058043873358827521\/YOOYwQY5_normal.jpg\",\"profile_banner_url\":\"https:\/\/pbs.twimg.com\/profile_banners\/3278814606\/1438769550\",\"profile_link_color\":\"1DA1F2\",\"profile_sidebar_border_color\":\"C0DEED\",\"profile_sidebar_fill_color\":\"DDEEF6\",\"profile_text_color\":\"333333\",\"profile_use_background_image\":true,\"has_extended_profile\":false,\"default_profile\":true,\"default_profile_image\":false,\"following\":false,\"follow_request_sent\":false,\"notifications\":false,\"translator_type\":\"none\",\"suspended\":false,\"needs_phone_verification\":false}"

用户名在属性中:

{
name: "T\\u00e2n Nguy\\u00ea\\u0303n"
}

如何将字符串解码为 un​​icode 字符 (Tân Nguyễn)?

我试过:

console.log(decodeURIComponent("T\\u00e2n Nguy\\u00ea\\u0303n"));

但它使用相同的字符串记录。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com