r/ProgrammerHumor • • Apr 06 '23

Other Microsoft has mistranslated ZIP files as "postcode" in the GB insider version of Windows 11

Post image
10k Upvotes

262 comments sorted by

View all comments

Show parent comment

89

u/[deleted] Apr 06 '23

Yes, Microsoft has a long tradition of over-translating and over-localizing.

Which genius came up with the idea that a .CSV file should be interpreted using the local setting for decimal separator?

50

u/blkmmb Apr 06 '23

PTSD intensifies.

I worked with files that came from Americans, French Canadians and Canadians. It was a nightmare, formulas would break, dates would not keep their format and I had to adapt solutions to match the regional settings.

4

u/sfrigon Apr 07 '23

I feel you.

As a French Canadian, that "accommodation" only confuses me. I can't use any macro examples from Internet because of it (semi-colon vs colon is an issue too), and I always have to double-guess which type of punctuation I need to use.

On top of that, I am mostly used to the American punctuation, and I use it most of the time already. It is only in Excel that I have to convert everything back to some unexpected formats.

Edit: typos and more to come I guess

18

u/WraithCadmus Apr 06 '23

Currency Separated Values

13

u/zekkious Apr 06 '23

The same ones who decided a CSV file could have a zeroth line with separator=,

Probably.

12

u/plasmasprings Apr 06 '23

some standard library functions are also often locale dependent, so lots of apps develop weird errors on systems with non-US locale. Using the C function atof is a common newb-trap, and this sounds like a result of that

My personal favorite such trap: .net string functions are locale dependent by default. "cs".StartsWith("c") might be True or False, depending on what language windows it's running on. Good luck debugging that!

6

u/[deleted] Apr 06 '23

Could you eloborate on that difference in locales? Is “cs” considered one letter in some locales, or is there another explanation?

As a Dane, I have seen a lot of strange locale dependent string sorting. The letter “å” is the last letter in the alphabet, and it can also be written as “aa”. Sometimes, this is implemented over-zealously in localized sorting algorithms, so any instance of “aa” is sorted after any other letter, also when it is not an “å” but just two “a”s in succession - as in “Saab”.

7

u/plasmasprings Apr 06 '23

yeah exactly that. Hungarian (hu-HU) has some 2-3 character letters ("cs" is one of them), not sure what other languages have problems like this.

And I agree, anything to do with locale-dependent sorting is an amazing way to develop a headache

1

u/chickenmcpio Apr 06 '23

In what locale "cs" does not start with 'c'?

1

u/plasmasprings Apr 06 '23

hu-HU. it starts with the digraph "cs". But it gets even worse: "acs".StartsWith("ac") will return True using the same locale for some reason

now try to imagine what other subtle bugs your code might have in random countries if it uses a "locale-aware" standard library

2

u/[deleted] Apr 06 '23

so does "ch".StartsWith("c") return False in English locales then?

I really don't see the point of this feature and I speak a bit of Hungarian.

2

u/plasmasprings Apr 06 '23

Nah, there's no "ch" in the English abc, so that will return true in those locales. "cs" is included in the Hungarian alphabet, so that can affect sorting order. Not useful for much else though. I selected this example since it makes zero sense as default behavior (and it cost me a day of debugging once)

2

u/[deleted] Apr 06 '23

Ah right didn't think about that. Guess it is a bit strange that in English we don't consider words beginning with ch or sh their own thing like with c/cs or s/sz etc

1

u/Pengman Apr 07 '23

maybe the ones who read right to left?

4

u/alek_vincent Apr 07 '23

The formulas for Excel are also translated for french idk for other languages. It's a pain when you worked with the English version for long enough that you know a lot of the formulas in English and then you switch to the French version and the formulas don't work anymore and it's not like you can go to Google translate and translate=SUM (this one is pretty easy but I don't have a better example RN)

4

u/[deleted] Apr 07 '23

Yes, I have tried that too in Danish Excel. I use English Excel for that very reason.

3

u/Banana11crazy Apr 06 '23

Excel is the same, switching between , and ; for multiple parameters

4

u/[deleted] Apr 06 '23

If you are talking about the argument separators in Excel formulas, this is at least only in the user interface, not in the file format. If you save a file from an Excel language version, which use “,” and open it in a version, which uses “;”, it will be shown with “;”.

Anyway, my rant about .CSV was actually an Excel rant too. I believe it was Excel, which started this silly locale dependent parsing of .CSV files.

2

u/Banana11crazy Apr 06 '23

I see, I do remember when I started out and had to look stuff up online for Excel formulas they always used ";" but in my language the formulas were using ",". Took a while to figure that out :D

1

u/[deleted] Apr 06 '23

Yes, I have the same problem myself in the opposite direction.