culture invariant object ToString()

The System.Convert class has a static ToString overload that takes an object. Convert.ToString(obj, CultureInfo.InvariantCulture); Based on my benchmarks, this is roughly twice as fast as string.Format(CultureInfo.InvariantCulture, “{0}”, value) and, more importantly, it looks cleaner. However, if you are building a string already, I’d recommend FormattableString.Invariant. FormattableString.Invariant($”Object value: {obj}”)

CurrentCulture incorrectly defaulting to en-US in ASP.net

These are alternative places where you could search: I can’t find anywhere that’s settings the culture to ‘en-US’… but something is. Thread.CurrentThread.CurrentCulture.Name is outputting ‘en-US’ Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol is outputting ‘$’ Try looking for the InitializeCulture method, this method is overridden in ASP.Net pages to set the Culture like: protected override void InitializeCulture() { var hidden = … Read more

What is devops? [closed]

It’s not about “combining” Dev and Ops, that’s just the word for it as, I think, it was coined by Patrick Debois. As stated above, it’s about providing the scaffolding or structure, and the cultural change to accept intermingling of Dev-side and Ops-side talent, to allow you bridge the DevOps gap. What they used to … Read more

C# Cultures: Localize DayOfWeek?

How about DateTimeFormatInfo.CurrentInfo.GetDayName( dayOfWeek ) or DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName( dayOfWeek ) Simply takes a DayOfWeek enumeration and returns string that is the name in the current culture. Edit: If you’re looking for a specific culture it would be var cultureInfo = new CultureInfo( “it-IT” ); var dateTimeInfo = cultureInfo.DateTimeFormat; then you can call GetDayName or GetAbbreviatedDayName as … Read more

How to getting browser current locale preference using javascript?

The following properties exist on the navigator object (which can also be known as clientInformation on IE but there’s no reason ever to use that name): language (non-IE, browser install language) browserLanguage (IE, browser install language) userLanguage (IE, user-level OS-wide language setting) systemLanguage (IE, OS installation language) But! You should never use any of these … Read more

How are the chinese coding?

I maintain the Korean IME (Input Method Editor) for Microsoft Windows and Office. Thus I work with Korean devs on a daily basis, Japanese devs regularly, and Chinese devs occasionally. We all code in C/C++. I am most familiar with the code for the Korean IME. There are a few places with comments in Korean … Read more

tech