News for hackers. Stuff that matters.
Re:I couldn't debug the code because of my name by jasonpeacock on Wednesday October 20, 2021 @12:35PM (#28932755)
This is the modern, post-ASCII computing world, we should no longer be willing to settle for the lowest-common-denominator of ASCII-only strings.

There's no excuse for actively supported, paid products to have these problems today.

Re:I couldn't debug the code because of my name by ainar-g on Wednesday October 20, 2021 @12:40PM (#28932818)
Especially if those products are developed by a company from Russia, where Cyrillic is used. For me, a Russian myself, this situation is honestly ridiculous.
Re:I couldn't debug the code because of my name by zczc on Wednesday October 20, 2021 @03:56PM (#28935507)
Russian companies generally have ascii-only username policies
Re:I couldn't debug the code because of my name by mbesto on Wednesday October 20, 2021 @03:12PM (#28934852)
Do you write "if" statements in Cyrillic when you write in <insert Python/Ruby/Java/.NET/whatever>?
Re:I couldn't debug the code because of my name by nine_k on Wednesday October 20, 2021 @04:19PM (#28935906)
No. Keywords are ASCII everywhere (no, APL's are not words). Mixing English in keywords and non-English in identifiers feels odd.

Algol-68 supported localized sets of keywords; fortunately this language is gone.

You can #define non-ASCII stuff in modern C++. It's your best chance to "localize" a mainstream language.

Same would work for Clojure, but Lisp uses a lot of quirky abbreviations like `cdr` or `setq` that give awkward translations.

Re:I couldn't debug the code because of my name by pavel_lishin on Wednesday October 20, 2021 @04:40PM (#28936198)
It would be very amusing to see "если" in an if statement, given how much it looks and sound like "else" at a brief glance.
Re:I couldn't debug the code because of my name by 1-more on Thursday October 21, 2021 @10:30AM (#28944968)
There are a few computer languages that have non-english keywords though! And among them it looks like there was a version of Algol with Russian keywords, as well as a bunch of others in the list. Scanning it it would seem that Logo and BASIC get translated a lot, which makes sense for teaching young learners who haven't learned English yet.

https://en.wikipedia.org/wiki/Non-English-based_programming_...

Re:I couldn't debug the code because of my name by selfhoster11 on Thursday October 21, 2021 @02:36AM (#28941115)
Why not? Several programming languages in the olden era did get localised.
Re:I couldn't debug the code because of my name by GoblinSlayer on Wednesday October 20, 2021 @05:46PM (#28937168)
I thought ArnoldC was just a couple of #define's, but looks like it isn't.
Re:I couldn't debug the code because of my name by amenod on Wednesday October 20, 2021 @12:40PM (#28932811)
True. But these actively supported, paid products build upon layers and layers of no-longer-supported, free/opensource products. Good luck fixing them.

Not saying that this is OK, just explaining why using non-ascii characters, in this day and age, is still asking for trouble.

Re:I couldn't debug the code because of my name by SAI_Peregrinus on Wednesday October 20, 2021 @02:01PM (#28933806)
This is on the Windows version.

Windows 2000 is when the OS changed to UTF-16 by default. Before that Windows NT was UCS-2, IIRC only the DOS-based Windows versions were Windows-1252 internally, starting from Windows 1.0. So while ł wasn't supported in Windows 1, characters like ñ were. Windows has literally NEVER been an ASCII-based OS.

Re:I couldn't debug the code because of my name by horsawlarway on Wednesday October 20, 2021 @02:44PM (#28934459)
Sure, but having used a lot of the windows system apis (admittedly - a lot of years ago) it was a complete hodgepodge of which api would take a char vs a wchar, and then they tried to hide the whole thing behind tchar, which just made it even harder to keep track of.

Basically - I agree: This shouldn't be a problem, and 7 months is a long time to wait for a basic fix. But there are a lot of footguns hanging around in windows code with respect to character encodings.

Just looking at the first result on google for "c++ get windows home directory" shows this: https://docs.microsoft.com/en-us/windows/win32/api/userenv/n...

Which takes a long pointer to tchar string (LPTSTR) - so this behavior is dependent on the unicode settings of the project at compile time, even today.

Re:I couldn't debug the code because of my name by account42 on Thursday October 21, 2021 @09:49AM (#28944331)
> Which takes a long pointer to tchar string (LPTSTR) - so this behavior is dependent on the unicode settings of the project at compile time, even today.

The documentation is simply wrong, GetUserProfileDirectoryA which you linked always takes a LPSTR (always "ANSI") while GetUserProfileDirectoryW always takes a LPWSTR (always WTF-16). This is reflected in the function prototype at the top. Only the define GetUserProfileDirectory switches between these two. The define is a compatibility hack and arguably was a mistake, but you can always the W-suffixed function no matter what the project settings are.

Re:I couldn't debug the code because of my name by david_allison on Wednesday October 20, 2021 @05:24PM (#28936867)
> Windows 2000 is when the OS changed to UTF-16 by default.

Paths are UTF-16 + unpaired surrogates, so a Windows path isn't legally representable in UTF-8.

Re:I couldn't debug the code because of my name by account42 on Thursday October 21, 2021 @09:54AM (#28944407)
But WTF-16 paths can be converted to WTF-8 just fine. You can even use the same algorithm, just only pair surrogates if they are matching an otherwise interpret them as UCS-2 values and encode those normally to "UTF-8".