Windows文化设置:单引号与右单引号 [英] Windows Culture Settings: apostrophe vs right single quotation mark

查看:78
本文介绍了Windows文化设置:单引号与右单引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然,某些测试在我的机器上变成红色,并失败,并显示以下消息:输入字符串的格式不正确.

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

这些测试采用一堆数字和字符串,并将它们与给定的区域性进行比较(例如此处的"de-CH" ):

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")]

我们发现,我们需要将单引号(请参见12 ' 345)更改为正确的单引号",以再次使测试变为绿色:

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.

我可以想象这与几天前应用于我的计算机的Windows Fall Creators Update [1709]有关,但不适用于我的同事.

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'.

有人知道瑞士的默认Windows设置是否更改过,或者是否将分隔符从单引号更改为正确的单引号?

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?

推荐答案

尝试直接从注册表中更改千"提示:此即将到来的代码行位于vb.net:

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",,")

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

这篇关于Windows文化设置:单引号与右单引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆