Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Byte array, ASCII encoding
#8
Thanks for your explanation.

I have the following PowerShell code, which can escape text in a specific format into Unicode encoding. Is there a simple implementation method in QM?
The ultimate result of the code execution is to echo the text.

{"status":{"code":"1","message":"操作已经成功完成","created_at":"2023-09-23 06:58:47"}
 
Code:
Copy      Help
$Uni_s =@'
{"status":{"code":"1","message":"\u64cd\u4f5c\u5df2\u7ecf\u6210\u529f\u5b8c\u6210","created_at":"2023-09-23 06:58:47"}
'@
$match = {
    param ($v)
    [char][int]($v.Value.replace('\u', '0x'))
}
[regex]::Replace($Uni_s, '\\u[0-9-a-f]{4}', $match)


Messages In This Thread
Byte array, ASCII encoding - by Davider - 09-06-2023, 09:42 AM
RE: Byte array, ASCII encoding - by Kevin - 09-06-2023, 11:15 PM
RE: Byte array, ASCII encoding - by Davider - 09-07-2023, 01:11 AM
RE: Byte array, ASCII encoding - by Kevin - 09-07-2023, 06:14 PM
RE: Byte array, ASCII encoding - by Gintaras - 09-07-2023, 06:45 PM
RE: Byte array, ASCII encoding - by Davider - 09-22-2023, 12:49 PM
RE: Byte array, ASCII encoding - by Gintaras - 09-22-2023, 02:59 PM
RE: Byte array, ASCII encoding - by Davider - 09-22-2023, 11:16 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)