Skip to content

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

Closed

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 'Привет мир'

Activity

  1. added
    bug
    on Nov 16, 2025
  2. changed the title [-]Bug with Cyrillic alphabet, with format() and %q[/-] [+]Bug with Cyrillic alphabet flips every 4 bytes in format() and %q[/+] on Nov 16, 2025
  3. SimoSbara commented on Dec 18, 2025

    @SimoSbara
    Contributor

    Hello, which file encoding are you using in your source code?

  4. AmyrAhmady commented on Dec 27, 2025

    @AmyrAhmady
    Member

    Fixed and will be available in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions