samp-node icon indicating copy to clipboard operation
samp-node copied to clipboard

Add character param type

Open ghosty2004 opened this issue 3 years ago • 3 comments

Hi, can you add character param type for events call ? "c" (when you have free time 😅)

ghosty2004 avatar Mar 27 '22 20:03 ghosty2004

Same requirement as issue #2. @AmyrAhmady The callNatives with the a flag can realize the one-way internationalized different character set transfer from server to client, but the callback events in the client, such as OnPlayerText, OnPlayerCommandText, OnRconCommand, OnDialogResponse The content returned with s as the marker is the result of wrong encoding and processing, at this time the translation by byte stream has lost its meaning, can we add or rewrite the native callback function marker or the result of the string passed as "a", that is, the native byte array of unprocessed string, like [97, 98, ...].

dockfries avatar Jul 26 '22 09:07 dockfries

"abc0123你好" utf8 [ 97, 98, 99, 48, 49, 50, 51, 228, 189, 160, 229, 165, 189]; gbk [ 97, 98, 99, 48, 49, 50, 51, 196, 227, 186, 195]

dockfries avatar Jul 26 '22 09:07 dockfries

It may be more complex to implement directly from the framework.

I wrote some small libraries, you can see my infernus and infernus-starter template repository.

I implemented the correct way to internationalize different character sets for windows by decorating gamemode with a "polyfill"(as I call it, like babel.js), but it was still up to the player to choose the character set, and there was still a problem if the player chose the wrong one.

dockfries avatar Jan 03 '23 15:01 dockfries