Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charset problem #61

Open
Disinterpreter opened this issue Jun 27, 2020 · 5 comments
Open

Charset problem #61

Disinterpreter opened this issue Jun 27, 2020 · 5 comments
Labels
bug Something isn't working core The issue depends from the code of the module.

Comments

@Disinterpreter
Copy link
Member

Disinterpreter commented Jun 27, 2020

Describe the bug
Sometimes in differents part of the code I see a unicode problem.

To reproduce

  1. Take grandlarc.
  2. Put this code
  3. Type in chat something in Unicode
public OnPlayerText(playerid, text[])
{
    new pText[144];
    format(pText, sizeof (pText), "(%d) %s", playerid, text);
    SendPlayerMessageToAll(playerid, pText);
    return 0; // ignore the default text and send the custom one
}

Screenshots
https://youtu.be/v2sRGcl1AMk

@Disinterpreter Disinterpreter added the bug Something isn't working label Jun 27, 2020
@Disinterpreter Disinterpreter changed the title Unicode problem Charset problem Jun 27, 2020
@Disinterpreter Disinterpreter added the core The issue depends from the code of the module. label Jun 27, 2020
@Disinterpreter
Copy link
Member Author

Disinterpreter commented Jun 27, 2020

I found a strange behavior.

It works fine when I put first symbol something like !@#$%^&*()-=_
image

@Daniel-Cortez
Copy link

Daniel-Cortez commented Jun 30, 2020

Judging by the video in the 1'st post, the problem must be in character conversion from char to cell - since both types are signed, the conversion is probably done with sign extension, so if a source symbol has a value >= 128, then all bits in the higher 3 bytes of a cell are set to 1 (so, for example, 0x80 becomes 0xFFFFFF80 instead of 0x00000080), which is later treated as 3 cyrillic symbols 'я' being inserted before each source symbol ('я' has the code FF). At least that's the bug that most of SA-MP string functions have; kinda funny seeing the same bug being repeated here :)

@ablemor
Copy link

ablemor commented Oct 20, 2021

disinterpreter, can u help me? do u have a fix for this issue?

@ablemor ablemor mentioned this issue Oct 20, 2021
@Disinterpreter
Copy link
Member Author

disinterpreter, can u help me? do u have a fix for this issue?

If the issue is open, so nobody fixed this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core The issue depends from the code of the module.
Projects
None yet
Development

No branches or pull requests

3 participants