by Michael S. Kaplan, published on 2006/01/06 03:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/01/06/509772.aspx
Just yesterday, Raymond Chen was talking about Converting between LCIDs and RFC 1766 language codes. He was basically showing how to use MLang's GetRfc1766FromLcid method to do the conversions between these two items.
Under ordinary circumstances I would rather slide down a razor blade into a barrel of iodine than disagree with something that Raymond has posted, but in this case it might be better to either:
The reason for this is that MLang itself, while entirely supported, is really not being actively developed right now. And any time there is a better option to go with, it should probably not be the first choice.
Though it is sometimes the only good choice out there, for example in low-level font linking and code page detection (sorry, no post yet -- I'll have to blog about that at some point!). And even going the opposite direction (from name to LCID in an unmanaged, non-Vista scenario where there are no other good options), MLang might be the way to go.
But beyond that, it may be best to steer clear of MLang if you have a choice -- you will likely be a lot happier with the results....
This post brought to you by "ῴ" (U+1ff4, a.k.a. GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI)
# PatriotB on 6 Jan 2006 12:21 PM:
# Michael S. Kaplan on 6 Jan 2006 12:51 PM:
# NikWeber on 6 Jan 2006 12:59 PM:
pcunite on 29 Feb 2008 8:51 PM:
>> When I trace into MultibyteToWideChar the
>> proper internal structure gets allocated, but
>> the callback function for the Unicode->50220
>> is null.
This is how it should be.
1. MultibyteToWideChar is taking a smaller bit into a larger bit space. Works.
2. WideCharToMultibyte takes a large (16 bit) into a smaller (8 bit usually) encoding. 8 bit is only good for 255 chacters.
3. So what do you think is going to happen when you realize 50220 needs more than 8 bits? Yeah, ??? or worse charcters show up!
Just say no to WideCharToMultibyte()!
Cain T. S. Random on 1 Apr 2008 9:09 AM:
Nik: I'm having the exact same problem with codepage 50220. It's valid Unicode, but WideCharToMultiByte refuses to accept it. However, Mlang will. To deprecate the only working solution would be frustrating.
go to newer or older post, or back to index or month or day