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

sqf: unicode problems #749

Open
PabstMirror opened this issue Sep 1, 2024 · 0 comments
Open

sqf: unicode problems #749

PabstMirror opened this issue Sep 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@PabstMirror
Copy link
Collaborator

Tools (complete and add to the following information):

  • HEMTT: main

Description:
Unicode in sqf can cause problems for any code bellow it.
Seems like Span//Ranges are sometimes assumed to be by byte instead of by char??

Steps to reproduce:
Build with some sqf with unicode:

"🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭";
private _workingArms = if (alive player) then { 2 } else { 0 };

Logs:

thread '<unnamed>' panicked at libs\sqf\src\analyze\codes\saa1_if_assign.rs:97:43:
byte index 88 is not a char boundary; it is inside '🌭' (bytes 85..89) of `"🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭🌭";

Additional context:
I don't think unicode in sqf is that common,
and I don't think anyone has a real world example of it causing a problem,
so this might be something that can be ignored for now

@PabstMirror PabstMirror added the bug Something isn't working label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant