1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-27 06:23:53 +01:00

Fix unicode conversion

This commit is contained in:
Konrad Kosmatka
2024-01-23 13:07:25 +01:00
parent 2a7ff7797a
commit d3e013f604

View File

@@ -164,12 +164,11 @@ rdsparser.register_rt(rds, callbacks.rt);
rdsparser.register_ptyn(rds, callbacks.ptyn);
rdsparser.register_ct(rds, callbacks.ct);
const decode_unicode = function(string)
{
const decode_unicode = function(string) {
let content = rdsparser.string_get_content(string);
let length = rdsparser.string_get_length(string);
let array = koffi.decode(content, koffi.array(unicode_type, length));
return Buffer.from(array, 'utf-8').toString();
return String.fromCodePoint.apply(String, array);
};
const decode_errors = function(string) {