Using XP SP2 cultures on Windows Server 2003 with CultureAndRegionInfoBuilder and ldml  
Author Message
AGBrown





PostPosted: .NET Base Class Library, Using XP SP2 cultures on Windows Server 2003 with CultureAndRegionInfoBuilder and ldml Top

I'm trying to use the XP SP2 cultureInfo for Welsh (cy-GB) in an ASP.NET application. The application runs fine on the development machine, but fails on the test server that is running Windows Server 2003 (standard, SP1). The reason is obvious enough; cy-GB only ships in XP SP2, and does not support WS2k3.

However, Michael Kaplan has a whole load of stuff on using ELKs, and one article in particular on using the CultureAndRegionInfoBuilder (https://beta.blogs.msdn.com/michkap/archive/2006/04/20/579579.aspx) to "move" cy-GB (and others, by extension) onto WS2k3.

But, I can't get it to work. The code I have is exactly as written in the article, it just saves an ldml on Win XP SP2, then I move it to WS2k3 and try and register it. I just get an error of "System.Xml.Schema.XmlSchemaValidationException: Culture name 'cy-gb' is not supported" on the first line:

The details are below. Has anyone had any success with this technique Is there anything about my WS2k3 setup that could be causing this, or is there an alternative way to get Welsh CultureInfo onto my web server

Andy


.NET Development30  

 
 
DveMac





PostPosted: .NET Base Class Library, Using XP SP2 cultures on Windows Server 2003 with CultureAndRegionInfoBuilder and ldml Top


Hi,

Did you ever find a resolution to this issue I am having the exact same problem...

Dave

 
 
Guy Smith-Ferrier





PostPosted: .NET Base Class Library, Using XP SP2 cultures on Windows Server 2003 with CultureAndRegionInfoBuilder and ldml Top

Andy, Dave,

(Probably too late for you but might help someone else...)

The problem lies in the msLocale:textInfoName and msLocale:sortName elements of the LDML. Windows Server 2003 doesn't have any recognition of the cy-GB culture so cannot use this as the textinfo or sort parameters. You have to substitute it with another culture that it will recognise. (Of course this means that the culture will not compare, sort or otherwise return correct text information for the cy-GB culture).

You can download a chapter all about Custom Cultures that discusses this problem and the solution at http://www.dotneti18n.com/Downloads/SampleChapter.pdf. You can download a class called CultureAndRegionInfoBuilderHelper that has a method called Export that solves this problem at http://www.dotneti18n.com/Downloads/DotNetI18NSourceCodeForVisualStudio2005.zip.

Guy

Author of .NET Internationalization (Addison-Wesley, 2006) http://www.dotneti18n.com


 
 
AGBrown





PostPosted: .NET Base Class Library, Using XP SP2 cultures on Windows Server 2003 with CultureAndRegionInfoBuilder and ldml Top

Hi Guy,

Thanks for updating the thread, I had forgotten I'd ever posted this. For interest, Michael Kaplan has followed up (http://blogs.msdn.com/michkap/archive/2006/11/22/1122416.aspx) on his original article about this as well, explaining the source of the problem and how to fix it with two very simple lines of code.

Andy


 
 
Guy Smith-Ferrier





PostPosted: .NET Base Class Library, Using XP SP2 cultures on Windows Server 2003 with CultureAndRegionInfoBuilder and ldml Top

Andy,

Glad you got a result. I knew you weren't really still waiting for an answer - I just posted in case anyone else was looking. Michael's solution is a good one and only has the very minor drawback that the host machine must also have the culture for the TextInfo and CompareInfo objects which in nearly all cases it will.

Guy