Create a custom culture that might be wrong

T

Tony Johansson

Hi!

I'm reading in a book and there is some code that might be wrong. Here is
the code enclosed within ""
"CultureInfo usCulture = new CultureInfo("en-US");
RegionInfo usRegion = new RegionInfo("US");
CultureAndRegionInfoBuilder demoBuilder = new CultureAndRegionInfoBuilder
("en-US",
CultureAndRegionModifiers.Neutral);
demoBuilder.LoadDataFromCultureInfo(usCulture);
demoBuilder.LoadDataFromRegionInfo(usRegion);"

As you can see the CultureAndRegionModifiers is set to Neutral but according
to the MSDN doc this
Neutral should be used when you have a neutral custom culture but here in
this case you also load the Region info
which should not be included when you define a Neutal culture.

So accoding to me this CultureAndRegionModifiers should be changed to None
which should be used when you have a specific supplemental custom culture
which this custom culture is.

Do you agree with me ?

//Tony
 
T

Tony Johansson

Tony Johansson said:
Hi!

I'm reading in a book and there is some code that might be wrong. Here is
the code enclosed within ""
"CultureInfo usCulture = new CultureInfo("en-US");
RegionInfo usRegion = new RegionInfo("US");
CultureAndRegionInfoBuilder demoBuilder = new CultureAndRegionInfoBuilder
("en-US",
CultureAndRegionModifiers.Neutral);
demoBuilder.LoadDataFromCultureInfo(usCulture);
demoBuilder.LoadDataFromRegionInfo(usRegion);"

As you can see the CultureAndRegionModifiers is set to Neutral but
according to the MSDN doc this
Neutral should be used when you have a neutral custom culture but here in
this case you also load the Region info
which should not be included when you define a Neutal culture.

So accoding to me this CultureAndRegionModifiers should be changed to None
which should be used when you have a specific supplemental custom culture
which this custom culture is.

Do you agree with me ?

//Tony

Here I noticed that the book is very wrong because the only valid
alternative for CultureAndRegionModifiers is
Replacement because this culture is a predefined culture.

//Tony
 

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

Top