0

All of a sudden, some test turned red on my machine and failed with the message: Input string was not in a correct format.

These tests take a bunch of numbers and strings and compare them with a given culture (like "de-CH" here):

[TestCase(12345.67, "12'345.67", "de-CH")]
[TestCase("12'345.67", 12345.67, "de-CH")]
[TestCase(-12345, "-12'345", "de-CH")]

We found out, that we needed to change the apostrophe (see 12'345) to a "right single quotation mark" to turn the tests green again:

Unicode character                   Oct     Dec     Hex     HTML
'   apostrophe                      047     39      0x0027  '
’   right single quotation mark     020031  8217    0x2019  ’

So they now look like this and my machine loves it.

[TestCase(12345.67, "12’345.67", "de-CH")]
[TestCase("12’345.67", 12345.67, "de-CH")]
[TestCase(-12345, "-12’345", "de-CH")]

Unfortunately, it is the only one in our office.

I can imagine that this stands in relation to the Windows Fall Creators Update [1709] which was applied to my machine a few days ago, but not on my coworkers'.

Does anyone know if the default Windows settings for Switzerland did change or if they changed their separator char from apostrophes to right single quotation marks?

Waescher
  • 5,361
  • 3
  • 34
  • 51

1 Answers1

0

Try change "sThousand" directly from registry hint: this coming code line IN vb.net:

Microsoft.Win32.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\International", "sThousand", ",")

  • Thanks but that's not the problem here. I don't want to change it locally on my machine (`de-CH` is not even my current culture). I just encountered this issue and wanted to know where it comes from. The char did change obviously. – Waescher Jan 29 '18 at 11:52