Welcome to MSDN Blogs Sign in | Join | Help

April 2007 - Posts

Bob Eaton asked over in the microsoft.public.win32.programmer.international newsgroup: I'm trying to compare two Yi Unicode-encoded strings using lstrcmp (which underlyingly uses CompareString). But when I compare the two strings, lstrcmp always returns Read More...
Marco asked: Given a XSLT stylesheet with the following element: <xsl:output method="html" encoding="Windows-1252"/> NET Framework 1.1 System.Xml.Xsl.XslTransform.Transform method outputs: <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252"> Read More...
You may have seen part 1 and part 2 of this series. Here we are with part 3! Pavel S. Tsarevskiy asked last month over in the microsoft.public.win32.prograsmmer.international newsgroup: I have a problem with using LoadMUILibrary() function and MUI technology Read More...
There are many people who are writing code in C/C++ who try to use the more portable CRT functions rather than the Win32 ones. Since in many cases the CRT functions actually wrap the Win32 functions when you run on Windows anyway, this approach allows Read More...
I was asked via the Contact link: Why does CharPrevExA/CharNextExA take a WORD for code page, whereas MultiByteToWideChar takes a UINT? Which type should I use to store code pages? It is true that CharNextExA and CharPrevExA take WORD values for code Read More...
I had someone ask me the other day what kind of testing was done for MSLU. I told him that the whole project was an interesting example of how the places you expect to find bugs are fine while the places you think are fun have many bugs! As a starting Read More...
Björn pointed out a new take on the system locale (a.k.a. the Language for non-Unicode Programs) in Vista, from the help: Now compared to the confusion people hit in Windows 2000 and even in Windows XP/Server 2003 , it seems nice to see the area covered Read More...
Vivek's question over in the microsoft.public.win32.programmer.international newsgroup really confused me: What is the sizeof wchar_t / WCHAR on WIN64 platforms? Is it 4 bytes and UTF32 or same as WIN32 -- 2 bytes and UTF16? I wasn't confused due to not Read More...
The 4400 is an interesting television show that this post has nothing to do with. This post is about what happens if you run the script from No Regex in the Unicode room! (and no sex in the champagne room, either!) on a Vista machine. Basically, you will Read More...
(apologies to Chris Rock for the title!) Ted first sent me mail years ago, he was asking some questions about MSLU and Julie (who knew Ted back from when he was working for Microsoft) sent him to me. If memory serves he actually pointed out an interesting Read More...
The other day, Keith asked in the Suggestion Box: In creating an on screen keyboard for Korean, I began to notice that the Korean IME seems to do things differently than, say, the Japanese IME. In Japanese, to get the characters from the ToUnicodeEx function Read More...
A while back Patrick asked me: Hi Michael, Please forward if you’re not the right person to ask the question… Let’s say I have the following code snippet. int comparison = String.Compare( x, y, StringComparison.CurrentCultureIgnoreCase); if (comparison Read More...
OK, I previously talked about the problem with Ordinal comparisons and one of the more uncool suggested ways around the problem . So what is a potential better way to approach the problem? Well, if we take the simplified model of the Ordinal comparison Read More...
One of the things that MSKLC does in its installation packages is add the necessary registry key and related values to support the keyboard layout on the machine. These are the ones under HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts . Anyway, Read More...
I was told about the cause behind an interesting bug a few hours ago. The behavior: A crash in managed code running on Server 2003 with the following call stack: System.ArgumentException: Culture ID 2155 (0x086B) is not a supported culture. Parameter Read More...
Just because you build up a huge architecture plan for a software plan doesn't mean that you can't use a sensible shortcut or optimization from time to time. Like for example, MSLU was set up to "speak Unicode" with its callers and "speak ANSI" with the Read More...
About a week ago I was talking about The problem with using ordinal (a.k.a. lexicographic, a.k.a. binary) type comparisons and I mentioned that I talk about it a bit tomorrow. Well, it was one of those newfangled tomorrows that happen about a week later.... Read More...
The width of a string in the console can be a tricky question to calculate. So earlier today when Eugene asked: What is the right way to figure out how many columns on a console will be needed to display a Unicode string? I believe wcwidth does that for Read More...
An interesting question came up the other day in relation to EUDC (which I have talked about before ): Hi,ALL I have a question about installation of "Private Character Fonts " using "users authorization". Currently my customer uses windows XP and users Read More...
A few days ago, Raymond was talking about the Notepad file encoding problem , again. And the comments were pretty funny, like watching a traffic accident as people started going off the rails in all kinds of directions. For the record, here is the official, Read More...
The question that was asked to the popular alias about Win32 development: We’ve got a stubborn machine on which a CMD window opened by the user emits date /t as “Thu 04/19/2007” whereas when Visual Studio 2005 runs a .cmd file from a build-step, date Read More...
People will, even now, tend to confuse the keyboard hardware with the keyboard software. (ref: this post and this one, for starters) After installing MSKLC and using it, they will wonder why their installed layout does not show up on the hardware list Read More...
Funny how you can discover something that changes nothing about you yet somehow makes it all look different. I was looking for a link over on MSDN and noticed something fun. Look at the search for MultiByteToWideChar, right here . My post A few of the Read More...
Jochen Kalmbach asks over in the Suggestion Box: Hi Michael! Short question: Is "CharNextExA" broken in XP (or generally borken)? It does not recognize UTF8... Here is a small example: #include <windows.h> #include <tchar.h> #include <stdio.h> Read More...
If only you could include screen shots in Microsoft Knowledge Base articles. I mean, could you imagine being in Product Support and trying to write up the text description for the following for a KB article? Actually, a customer named Pavel had the same Read More...
(In the interests of avoding Uighur/Uyghur discussions, I will use Uyghur for the rest of the post!) There is a table that appears in a few Wikipedia articles (such as this one and this one ), and when you look at the table, at the ULY effort in general, Read More...
Over in the Suggestion Box, zvi k asks: Hello, I tried to use MultiByteToWideChar() function to convert UTF-16 encoded string and it failed. Is it designed to get only ANSI / UTF-8 code or it can get UTF-16 format with special parameters? (I accent - Read More...
The reason why these comparisons are popular is not because they make sense. The order, in fact, when based on code point value (as most implementations are), is an entirely arbitrary and non-intuitive side effect of the place in which characters are Read More...
You may not use Microsoft Access much, and if you do use Access you may not use DAO much. So if you want to skip this post you should feel free to do so. :-) Here is some code: Sub WhatAreYouTryingToProveAnyway() Dim db As DAO.Database Dim rs As DAO.Recordset Read More...
Chris asked: I am using the following constructor for StreamReader: StreamReader (String, Boolean) Initializes a new instance of the StreamReader class for the specified file name, with the specified byte order mark detection option. However, when I look Read More...
We've been talking about DPI a whole bunch, including not disabling and disabling the high DPI support in Vista. These two screen shots taken on a machine with 192 DPI will not show the final word (that comes in another post, soon!), but they will provide Read More...
Aaron asks (via the Contact link): I apologize for this totally unsolicited email, but I'm starting to wonder if I'm crazy or not. I'm using GetLocaleInfo to determine what language the user wants their UI strings displayed in. I'm using LOCALE_SISO639LANGNAME Read More...
I may never be entirely used to working for Microsoft, as opposed to working with Microsoft products.... One of the things Scott Hanselman suggested yesterday in response to this whole series about font embedding in a managed application (prior posts Read More...
(see also parts 1 , 2 , and 3 ) OK, we are getting close to the end of this little mini-series.... First there was a comment from Dennis E. Hamilton asking about the DPI in the screen shots of that first post: I notice two things here. First, the impact Read More...
(see also the first part and the second part) We now have that binary chunk that needs to be loaded, so let's go ahead and load it! The core bit of the code for this should have been: if (File.Exists(FONTNAME)) { // We are reading in the embed file info Read More...
(see here for the first part) The first part of the code centers around a call to TTEmbedFont . It only runs on Vista and above (since no one else should have the font on their machine!): IntPtr hDC = CreateDC("DISPLAY", IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); Read More...
I have a lot of ideas for blog posts that are on my generic "to do" list. In fact, any time someone suggests a potential topic these days, I already had the topic on my list of things to cover some day.... I was looking at my blog summary page a moment Read More...
(Absolutely positively nothing technical, whatsoever) My grandmother said those words as I stood in the kitchen, about to head out to the car taking me to the airport. Of course I still had to go. I had been in Ohio a week, probably one of the longest Read More...
Just as there are stages to grief, it seems there are stages to support of collation in both product and platform.... STAGE #1: IGNORANCE (a.k.a. Denial) This first stage has one just going and doing as one pleases, adding language sorts and fixing bugs Read More...
Koushal asks via the contact link: Hi Michael, How you doin? I found your reply to a post regarding the steps to be followed and APIs to be used to get a list of tables in a .edb file using ESE APIs. You've written that you are not providing the sample Read More...
The question in the microsoft.public.word.international.features newsgroup was: In Europe the handwritten number seven has a short horizontal line through it. My question: Is there any Word 2007 or Vista system font that allows one to type such a European-style Read More...
Well, here is my logic. The System.String class has many members that support the current culture by default, and other cultures/comparison types by parameter. You know, like string.Compare and so on. But there is one member that does not have this behavior, Read More...
Sometimes, in order get the best results in collation, one has to use constructs that from a linguistic or a Unicode general category standpoint might seem incorrect. A good example is times that a character which is not on the list of Mn (Mark, Nonspacing) Read More...
Yesterday's Win9x keyboard file source? kind of anticipates this post, I suppose. But it is happier news, at least. :-) The Windows Driver Kit (WDK) has both information on keyboard layouts on NT-based platforms and the build-able source and header files Read More...
Thorsten Glaser asked over in the Suggestion Box: Hi, thanks for MSKLC, now I'm able to have the same keyboard layout on the BSD wscons (text mode) console, under X-Window and on Windows NT/2k/… – with a “meta” key that just adds 0x80 to the value of Read More...
You know how I talk about best practices here sometimes? And the worst ways to misuse various globalization/internationalization methods and functions? Well, believe it or not, sometimes even the Microsoft code gets it wrong. (Gasp!) Like the other day, Read More...
(I am still on vacation, but some news just shouldn't have to wait!) I promised that the हिन्दी (Hindi) LIP would the first of many.... and now they have made good on this promise. There are in fact two LIPs now available. One for Català (Catalan) and Read More...
I am on vacation this week (in Beachwood, Ohio visiting family). Thought I'd mention it here just so no one thinks I am trapped under something heavy or was hit by a bus or anything.... I have been inspired by a topic or three so I may blog some later Read More...
People often talk about the "GDI Font Cache" as if it were a real entity. And those same people may explain how a call to AddFontResource will dynamically update the font cache, session wide. Some of them may even how explain how the font list under HKLM\SOFTWARE\Microsoft\Windows Read More...
Moving past the issues I discussed in I Kana understand you, could you repeater that? (Part 1) , there are some additional ones of interest. There are several characters here that can be added to the discussion beyond U+3005 and U+303b : U+3031 (〱) -- Read More...
 
Page view tracker