I would post a good programming horror that my professor gave, but I can't share course content for academic integrity reasons and also because I don't want to dox myself.
The editor is using a font without support for Cyrillic characters.
Too lazy to type the full explanation, so here's an AI summary that explains it. The only thing is that I propose OP did this intentionally, rather then accidentally.
-- This is a classic example of a font-fallback illusion combined with a keyboard layout mishap:
The Keyboard Swapping Mishap: While typing, your system keyboard layout accidentally switched to a Russian/Cyrillic layout. You intended to type inline size_t, but when you pressed the keys for i-n-l-i, your keyboard registered the Cyrillic keys ш-т-д-ш. You then realized the mistake or swapped back, and finished typing size_t normally.
Font Fallback Behavior: Your code editor uses a fixed-width programming font that doesn't natively contain standard visual glyphs for Cyrillic characters like ш, т, or д. To prevent showing broken empty rectangles (called "tofu") or question marks, your modern editor automatically "borrows" lookalike characters from a fallback system font.
The Coincidence: Because of how text scales and renders in this fallback font, the characters штдш are being forced to visually squeeze and mask themselves right on top of where the compiler reads the hidden bytes, mimicking the visual letters si.
the stuff that comes with that aberration of Win32.h or whatever WinApi which could break portability, just stick with stdint.h and whatever other std for other types, it's just common sense and headache prevention against winslop incredible decision making
288
u/Mr_Cursedd Oct 17 '26
штдшsize_t
111
u/Right_Ear_2230 Oct 17 '26
https://cppreference.com/cpp/string/basic_string/size
90
u/FloatingGhost Oct 17 '26
this is a verified
T_PAAMAYIM_NEKUDOTAYIMmoment19
u/arielif1 Oct 17 '26
wrong file encoding? that's the only thing i can imagine being wrong here, especially since the same Cyrillic character appears twice
36
u/Mucksh Oct 17 '26
What is the horror. Encoding issues on the file or that there is a custom function to return a string length
8
u/uglycaca123 Oct 18 '26
the solution is to define штдшsize_t as an alias for size_t, obviously /j
32
u/TechnoByte_ Oct 17 '26
Rule 1:
4
u/james_harushi Oct 17 '26
stdssize_t
4
u/_usr_nil Oct 17 '26
for the love of God don't fucking use windows types, holy shit