globalization

How to Response.Cookies.Append() in ASP.Net Core 1.1?

北城以北 提交于 2019-12-02 06:20:38
问题 I am trying to add Globalization to an Intranet application, using a cookie to allow users a culture preference. The middleware is set up and running but I have run into an issue with appending to the cookie based on the UI selection. The method is straight from the Asp.Net Core documentation as below: public void ConfigureServices(IServiceCollection services) { services.Configure<RequestLocalizationOptions>( options => { var supportedCultures = new List<CultureInfo> { new CultureInfo("en-US"

Detect if any right-to-left language is installed

别来无恙 提交于 2019-12-02 05:39:21
What is the easiest way to detect whether any right-to-left language is installed on the host Windows OS? (I need this in order to know if LTR marks will be displayed as squares, or work properly on the host OS) Probably unmanaged API like IsValidLanguageGroup , IsValidLocaleName (or IsValidLocale ) or IsValidCodePage is what you are looking for For example the code if (IsValidLanguageGroup (LGRPID_ARABIC, LGRPID_INSTALLED) || IsValidLanguageGroup (LGRPID_TURKIC, LGRPID_INSTALLED) || IsValidLanguageGroup (LGRPID_HEBREW, LGRPID_INSTALLED)) { // RTL is supported } can be used to test whether you

Globalization in JQuery is not working

倾然丶 夕夏残阳落幕 提交于 2019-12-02 04:20:46
I have been following the Scott Hanselman Tutorial on Globalized Javascript Validation. It is a great tutorial wich made me understand a topic I'm not that familiar with a bit better. The only problem is that it's a bit outdated because the link he provided to files like jquery.glob.fr.js is invalid. But you get redirected to the improved version by Jquery. That's ok, but They just don't do what they promise to do. I tried searching for tutorials and information about this, but the only help on the internet is the ReadMe file. They state this => Globalize.culture( "fr" ); console.log(

Globalization problem with DateTime and ASP.NET MVC 3 Model Binding

断了今生、忘了曾经 提交于 2019-12-02 03:33:14
问题 My application runs under ro-RO culture settings, configured in web.config globalization section. If I make a POST request like POST /myapp/index date=03-12-2010&value=something the model binding maps this to correct date value of "03 December 2010", since the default datetime format for ro-RO culture is dd-MM-yyyy. If I change the request method to GET passing the same data the date value in my action becomes "12 March 2010" (MM-dd-yyyy datetime format) GET /myapp/index?date=03-12-2010&value

Conversion from string “31/03/2012” to type 'Date' is not valid

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 03:03:22
My web app is running perfectly in asp vb.net editor. But when i run my web app through IIS7 then i get this error. What am i missing in configuring IIS7? Is there anyone who can suggest something? Thanks in Advance Because your IIS7 is configured for the English Language and that date is probably Italian or something similar. You'll have to tell to the Date.Parse which culture to use. Something like dateValue = Date.Parse(yourDate, CultureInfo.CreateSpecificCulture("it-IT")) Or you can change the culture in your IIS7 Here there are the instructions for example if you use the UI Using the UI

How to Response.Cookies.Append() in ASP.Net Core 1.1?

烂漫一生 提交于 2019-12-02 00:52:05
I am trying to add Globalization to an Intranet application, using a cookie to allow users a culture preference. The middleware is set up and running but I have run into an issue with appending to the cookie based on the UI selection. The method is straight from the Asp.Net Core documentation as below: public void ConfigureServices(IServiceCollection services) { services.Configure<RequestLocalizationOptions>( options => { var supportedCultures = new List<CultureInfo> { new CultureInfo("en-US"), new CultureInfo("en-GB"), new CultureInfo("fr-FR"), new CultureInfo("es-ES") }; options

Globalization problem with DateTime and ASP.NET MVC 3 Model Binding

核能气质少年 提交于 2019-12-01 23:43:30
My application runs under ro-RO culture settings, configured in web.config globalization section. If I make a POST request like POST /myapp/index date=03-12-2010&value=something the model binding maps this to correct date value of "03 December 2010", since the default datetime format for ro-RO culture is dd-MM-yyyy. If I change the request method to GET passing the same data the date value in my action becomes "12 March 2010" (MM-dd-yyyy datetime format) GET /myapp/index?date=03-12-2010&value=something $.getJSON('/Home/Index', $('form').serialize(), function(d) { // ... }); $.post('/Home/Index

.NET Convert from string of Hex values into Unicode characters (Support different code pages)

早过忘川 提交于 2019-12-01 23:15:39
问题 I have a string of Hex values... String hexString = "8A65"; I need to convert this string into their Unicode equivalents. The tricky part is that I need to support different code pages and some code pages have '8A65' = one character whereas other code pages would convert it into two characters. I have no prior knowledge of which code page I will be using until I need to perform the conversion. I've tried all sorts of stuff such as byte[] original = Encoding.Unicode.GetBytes(hexString); byte[]

DateTimePicker for custom calendars

筅森魡賤 提交于 2019-12-01 23:10:37
Do you know any DateTimePickers for calendars other than the Gregorian calendar? Can you be more specific as to which type of Calendar you are interested in? There is a Farsi calendar control available on code project: http://www.codeproject.com/KB/selection/FarsiLibrary.aspx try the RadControls: RadCalendar for ASP.NET AJAX: http://www.telerik.com/products/aspnet-ajax/calendar.aspx RadCalendar for WinForms: http://www.telerik.com/products/winforms/calendar.aspx you cant change the culture of a datetimepicker is not allow natively check this 来源: https://stackoverflow.com/questions/607658

.NET Convert from string of Hex values into Unicode characters (Support different code pages)

只愿长相守 提交于 2019-12-01 21:51:15
I have a string of Hex values... String hexString = "8A65"; I need to convert this string into their Unicode equivalents. The tricky part is that I need to support different code pages and some code pages have '8A65' = one character whereas other code pages would convert it into two characters. I have no prior knowledge of which code page I will be using until I need to perform the conversion. I've tried all sorts of stuff such as byte[] original = Encoding.Unicode.GetBytes(hexString); byte[] conv= Encoding.Convert(Encoding.Unicode, Encoding.GetEncoding(932), orig); char[] chars = Encoding