Forum Cross Platform with Xamarin

CultureNotFoundException problem about culture info in IOS

huangjinshehuangjinshe USMember ✭✭✭

My culture name is : ug-CN,
But every time I create the culture : new CultureInfo("ug-CN"); it will throw exception: CultureNotFoundException.

For found out my culture name, I change the language in IOS 9.3( iphone 5s) simulator and Open my Xamarin.Form project check it:

string cultureName = NSLocale.CurrentLocale.LocaleIdentifier; // get the value in AppDelegate class

but it show me cultureName is : ug-Arab_CN

So I tried:
new CultureInfo("ug-Arab_CN");
new CultureInfo("ug-Arab-CN");
new CultureInfo("ug_Arab-CN");
new CultureInfo("Arab-CN");
new CultureInfo("ug-Arab");

always show me : System.Globalization.CultureNotFoundException: Culture name xx-xx(culture name) is not supported.

Is that a Xamarin Bug or what?
Is there anyone know about that? Thank you.


  • huangjinshehuangjinshe USMember ✭✭✭

    It's very helpful if we could register a new culture based one of the culture if our culture name not exists in the system or not support.

Sign In or Register to comment.