1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-26 22:13:53 +01:00

Merge pull request #7 from kkonradpl/unicode-fix

Fix unicode conversion
This commit is contained in:
Marek Farkaš
2024-01-23 13:09:28 +01:00
committed by GitHub

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) {