PlaceholderAPI / Javascript-Expansion

Adds javascript placeholders
GNU General Public License v3.0
22 stars 24 forks source link

Suggestion: Use utf-8 format for return string in js file #29

Closed BingYanchi closed 3 years ago

BingYanchi commented 4 years ago

When I tried to use Chinese in the return string, an encoding error occurred.

test.js

function main() {
    return "测试"
} main();

The output using /papi parse: image

Paper 1.16.1 PlaceholderAPI 2.10.9

BomBardyGamer commented 4 years ago

Can you show the stack trace please?

BingYanchi commented 4 years ago

Can you show the stack trace please?

I don't know how to operate, and I haven't encountered such a situation. Maybe you can try the above method to reproduce this situation.

WickyPlays commented 4 years ago

It's simply because you have no semicolon after the return part: function main() { return "测试"; } main();

BingYanchi commented 4 years ago

It's simply because you have no semicolon after the return part: function main() { return "测试"; } main();

I tried it, but the phenomenon reappeared. This may not be the problem.

BingYanchi commented 4 years ago

It's simply because you have no semicolon after the return part: function main() { return "测试"; } main();

Maybe there is something wrong with the encoding of the return output method, or it only appears in 1.16?