Questions tagged [culture]

Culture is the combination of language and peculiarities of geographical location (like en-UK, en-US, de-AT, de-DE, fr-BE)

Culture is the combination of language and peculiarities of geographical location (like en-GB, en-US, de-AT, de-DE, fr-BE)

815 questions
0
votes
1 answer

How to change date format culture for c# application which reads Excel

I am reading Excel file by using OLEDBConnection in C#. I want to change current thread culture as per culture of Excel file so I can get dates in culture specific formats. I have used following code but it is not working. It still converts date to…
user2671548
  • 1
  • 1
  • 2
  • 4
0
votes
1 answer

HTTP, side-effect free but not idempotent URL

Imagine a search page with various search parameters (e.g. last name, date of birth). We used a GET-based form and everything worked fine - until now. Last week we introduced globalization into our application and ran into problems with various…
D.R.
  • 20,268
  • 21
  • 102
  • 205
0
votes
0 answers

Calling ShowDialog changes culture (locale)

While calling a simple .Net form (FolderBrowserDialog), it turns out the culture is changed without notice following a call to ShowDialog(): string ChooseFolder(ref string sTitle, string sCurDir) { string folderPath = sCurDir; …
uv_
  • 746
  • 2
  • 13
  • 25
0
votes
0 answers

ASP MVC action parameter binding depending on culture

I have a multi cultural website in ASP.Net MVC with an action filter which take care to set the current culture of the application depending on several criterias (database, cookie, etc). My problem is that the user can submit a form with multiple…
Eric
  • 230
  • 1
  • 2
  • 15
0
votes
1 answer

Populate country list with respective two letter and three letter code in c#

Can any one please help in populating the list of country names, its respective two letter code and three letter codes.. I tried the below snippet, but its giving me incomplete results. static void Main(string[] args) { List
0
votes
1 answer

Is is safe to use Enum.Parse() regardless of current culture used in either end when passing integers

For C# floating points types, I understand that one "culture effect" is that ',' may be used instead of '.', but for integers types what are the possible effects? I ask since Int32.TryParse() will accept a CultureInfo.InvariantCulture…
crokusek
  • 5,345
  • 3
  • 43
  • 61
0
votes
1 answer

How to Compare URLs Case-Insensitively?

I'm trying to match the request URL sent to my ASP.NET application case-insensitively because bots or users might mistakenly request a non-canonical form and I need to redirect them. Which one of the comparison modes is semantically the best…
usr
  • 168,620
  • 35
  • 240
  • 369
0
votes
2 answers

Culture-conversion in C# with DateTime

I'm having trouble getting my ASPX-App to work on the productive server. As my local environment is german but the server is english and my whole code didn't provide culture-support, I'm currently implementing that throughout the script. As you…
F.P
  • 17,421
  • 34
  • 123
  • 189
0
votes
3 answers

Saving DateTime object on UK Dev Server vs US Live Server

I have a site that saves a date in my model to the database. After launching my site I realised that the server has US regional settings so I had to make sure that all date's on the public site were formatted in the UK format. However now when I go…
Jon
  • 38,814
  • 81
  • 233
  • 382
0
votes
3 answers

How can I set dot as decimal separator in GridView?

I have some BoundFields that are bonded to double values. If I enable editing on the GridView I get the following example: Input string was not in a correct format. I want that in edit mode the decimal separator be "." instead of "," but I can't…
dvjanm
  • 2,351
  • 1
  • 28
  • 42
0
votes
2 answers

Dynamically declare System.Globalization Calendars in a function?

I am playing with culture calendars. I would have thought GregorianCalendar (and the others) would be a type of under System.Globalization.Calendar, but it's not. It's a Globalization class equal to Calendar. In the function below, I don't think I…
Ted
  • 123
  • 3
  • 13
0
votes
1 answer

Display Chinese Japanese characters in WebPage

I was developing MVC3 application. In my Application, there will be a number of Chinese and Japanese characters. When showing those characters on the webpage I was getting some weird characters appears on the screen instead of Chinese or Japanese…
UniqueChar
  • 195
  • 2
  • 2
  • 13
0
votes
2 answers

Thread.Culture not being respected for model-binding in MVC2

To allow for culture-specific values to be bound correctly I have this ModelBinder: public class CultureAwareModelBinder : DefaultModelBinder { public override object BindModel(ControllerContext controllerContext, ModelBindingContext…
Dai
  • 141,631
  • 28
  • 261
  • 374
0
votes
2 answers

Searching for a Culture-Dependant Date in String

I need to search for, and parse, a datetime (formatted based on current culture) in a string. The best I can come up with at the moment is: string text = String.Format("Time is {0}; all's well", DateTime.Now); DateTime date = new DateTime(); for…
Murray
  • 1,948
  • 1
  • 12
  • 18
0
votes
1 answer

C# WP8 Resource file string limit

I want to give the user the option to change language so I created two resource files, one for Portuguese and another for English (US). For the name field I'm giving it names like String1, String2, String3, etc... And in the value field I'm writing…