You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GitHub formatter works without exceptions, although Psalm erroneously calculates the character (cuts two bytes of UTF-8 encoded ы in half getting �):
$ ./vendor/bin/psalm --output-format=github
Target PHP version: 8.3 (inferred from composer.json).
Scanning files...
Analyzing files...
::error file=test.php,line=3,col=12,title=InvalidArgument::test.php:3:12: InvalidArgument: Argument 1 of sprintf is invalid - Unknown format specifier "�" (see https://psalm.dev/004)
------------------------------
1 errors found
------------------------------
Checks took 0.01 seconds and used 1.692MB of memory
No files analyzed
Psalm was able to infer types for 100% of the codebase
The web service at https://psalm.dev/ gives empty response for this code, because it cannot build the JSON output for it.
The text was updated successfully, but these errors were encountered:
maximal
changed the title
Malformed JSON string due to erroneous UTF-8 character splitting
Malformed JSON output due to erroneous UTF-8 character splitting
Aug 13, 2024
although Psalm erroneously calculates the character (cuts two bytes of UTF-8 encoded ы in half getting �):
Actually, that's kinda correct. sprintf() takes one byte after the % character (if we ignore width specification for the sake of simplicity) as a specifier.
Now of course this shouldn't break output formatters.
This code breaks JSON formatter entirely (and the overall output slightly):
JSON formatter exception:
GitHub formatter works without exceptions, although Psalm erroneously calculates the character (cuts two bytes of UTF-8 encoded
ы
in half getting�
):The web service at https://psalm.dev/ gives empty response for this code, because it cannot build the JSON output for it.
The text was updated successfully, but these errors were encountered: