Skip to content

Bug with Cyrillic alphabet flips every 4 bytes in format() and %q #1143

@povargek

Description

@povargek

In format() function %q breaks the Cyrillic alphabet, flips every 4 bytes. If you add an ASCII symbol first, for example, a space, the problem is solved.

There is no such problem with %q in standard SA:MP server

{ // %q
  new string[100];
  new name[] = "Привет мир";
  format(string, sizeof(string), "Test string '%q'", name);
  printf(string);
}

{ // space + %q
  new string[100];
  new name[] = " Привет мир";
  format(string, sizeof(string), "Test string '%q'", name);
  printf(string);
}

{ // %s
  new string[100];
  new name[] = "Привет мир";
  format(string, sizeof(string), "Test string '%s'", name);
  printf(string);
}

OUTPUT
2025/07/25 17:19:31 [Info] Test string 'вирПм те'
2025/07/25 17:19:31 [Info] Test string ' Привет мир'
2025/07/25 17:19:31 [Info] Test string 'Привет мир'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions