Javascript processing Cyrillic input

后端 未结 2 1152
鱼传尺愫
鱼传尺愫 2021-01-22 08:00

When i get a json feed from a Cyrillic site, the data is in a \\ufffd format instead of Cyrillic chars.

(example feed: http://jsonduit.com/v1/f/l/7sg?cb=getJsonP_1284131

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-22 08:22

    decodeURIComponent("stringToDecodeToCyrillic")

    Example: decodeURIComponent("%D0%90%D0%BB%D0%B5%D0%BA%D1%81%D0%B5%D0%B9") === "Алексей"

    Fastest way to encode cyrillic letters for url

提交回复
热议问题