Globalization problem

F

FM

Hi,

I use the following code to set the current culture.

If Not IsNothing(Session("language")) Then
System.Threading.Thread.CurrentThread.CurrentCulture = New
System.Globalization.CultureInfo(Session("language").ToString)

End If

If the users's browser (IE) is configured in the languages section to
support Japanese (ja) I get the following error when I go on the page:

Culture "ja" is a neutral culture. It can not be used in formatting and
parsing and therefore cannot be set as the thread's current culture.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NotSupportedException: Culture "ja" is a neutral
culture. It can not be used in formatting and parsing and therefore cannot
be set as the thread's current culture.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[NotSupportedException: Culture "ja" is a neutral culture. It can not be
used in formatting and parsing and therefore cannot be set as the thread's
current culture.]
System.Globalization.CultureInfo.CheckNeutral(CultureInfo culture) +110
System.Threading.Thread.set_CurrentCulture(CultureInfo value) +17
ASPNetPortal.DesktopDefault.Page_Init(Object sender, EventArgs e) +208
System.Web.UI.Control.OnInit(EventArgs e) +67
System.Web.UI.Control.InitRecursive(Control namingContainer) +235
System.Web.UI.Page.ProcessRequestMain() +171





Any idea why this is hapening and what should I do would be much
appreciated.
Thanks,
Florian Marinoiu
 
N

Nicole Calinoiu

Florian,

Try providing the region information as well in order to create a specific
culture rather than a neutral culture. e.g.: "ja-JP instead" of just "ja".

HTH,
Nicole
 
N

Nicole Calinoiu

Florian,

Try providing the region information as well in order to create a specific
culture rather than a neutral culture. e.g.: "ja-JP instead" of just "ja".

HTH,
Nicole
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,602
Members
45,184
Latest member
ZNOChrista

Latest Threads

Top