Postings are provided as is with no warranties, and confer no rights. Opinions expressed here are my own delusions; my employers at best shake their heads and sigh, at worst repudiate the content with extreme prejudice, whenever it manages to appear on their radar.
This blog is unsuitable for overly sensitive persons with low self-esteem and/or no sense of humour. Proceed at your own risk. Use as directed. Do not spray directly into eyes. Caution: filling may be hot. Do not give to children under 60 years of age. Not labeled for individual sale. Do not read 'natas teews ym' backwards. Objects in mirror are closer than they appear. Chew before swallowing. Do not bend, fold, spindle or mutilate. Do not take orally unless directed by a physician. Remove baby before folding stroller. Not for use on unexplained calf pain.
A nice FLAIR (FLuid Attenuated Inversion Recovery) view from the not-too-distant past. Every abnormality you can see on this scan (and there is more than one!) is asymptomatic at present. Alongside is a picture of me walking the walls at Fremont Studios, a sign of a damaged brain.
This post is another of the series about international and non-international issues surrounding keyboards, MSKLC, and accessibility. Through them I will deal with issues important to developers in their application, issues important to keyboard authors in their works, and issues important in the use of MSKLC (and MSKLC's own accessibility triumphs and failures).
The first article deals with shortcuts. The second article deals with accelerators.
This article is going to take the second most visible piece of UI I have created since I came to Microsoft 1 and tear it apart, from an accessibility standpoint.
Developing the Microsoft Keyboard Layout Creator was a unique experience.
Almost all of the good ideas and concepts came from Cathy Wissink and Simon Earnshaw. At the time they represented the bulk of the NLS Program Management team (now they each have 5-6 people under them in GIFT -- we have grown quite a bit since then!). The three of us would have weekly meetings and talk about what kinds of tools would meet some of the customer requests that had been coming in. It was a little unconventional as projects go, since I did not have a spec to work from. But at these weekly meetings I was able to show them what I had and they were able to provide corrective measures. We started calling the meeting the Dog and Pony Show, shortened to Dog & Pony and eventually to D&P and these were very creative meetings with lots of good ideas in them.
I mention the D&P because it helps point to the continuous "beta" and "usability" testing that was happening throughout the development cycle of MSKLC. Although it was pretty unconventional, it proved to be very effective when things line up as they did.
One of the most worrying concepts that came up in some of these meetings was accessibility, and not just in the conventional sense of making sure there are shortcuts and accelerators. The entire user interface has to be accessible in an intuitive way. Even though the operation of keyboard authoring was not necessarily an intuitive one.
Look at a simple operation of assigning letters to keys:
You could use the mouse to select buttons on the "faux keyboard" that is the MSKLC user unterface, which opens the editing dialog.
Or you could press the key once to select it and a second time to open up an editing dialog.
Or you could use drag 'n drop to put text onto a key from Word or IE.
Or you could right-click on a key and get an array of editing choices.
Or you can use arrow keys to move around the keys to select the one you want.
Or you could load an existing keyboard layout and modify that 2.
The idea was that nobody would use all of these methods, but everyone would use the ones with which they were most comfortable. And very accessible.
Now with that said, there were things that did not quite as well, such as support for high contrast or large fonts. Though both problems are somewhat mitigated by the ability to change the colors and to resize the keyboard, respectively, there are tweaks to the DPI settings that can even mess up the layout of the resizing, which is pretty doubleplusungood.
All three of these functionalities (high contrast, large fonts, DPI changes) are considered important in many cases to accessibility in the conventional sense of the word. And the mitigation is not all that great even when it would work -- it would be better for MSKLC to simply handle these issues without requiring extra tweaks. Its just a feeling I have that if the UI is only usable to a customer after they change it then I have not really done the best I can for them....
There is also another kind of "accessibility". If you look at MSKLC it gives you 50 keys whose assignments you can alter and 10 more that you cannot. But these days even the smallest non-laptop keyboards have 101 keys, so what about the other 41 keys? If they cannot be accessed, isn't that an accessibility problem?
Well, yes, sorta. But most of those keys are things like the numeric keypad and the function keys and things that we really don't want people accessing, so it is not really something that anyone here loses too much sleep about. :-)
Now it is interesting to consider that the ability to create custom keyboards means that if there are specific problems or difficulties a user has such as a mising finger or fingers that a keyboard can be fashioned which will help them by assigning the most common letters to the keys that are most accessible to the individual user. I was indeed contacted by someone from the Accessibility team just before we shipped MSKLC who we talked with about potential usages of the tool.
This is not the only example of such a collabotation. We often end up either working together or doing each others' work -- for example, the Windows Accessibility folks are the ones who own and had developed the OSK (On-Screen Keyboard), which is often used by people trying to use other language keyboards when they do not know the layout. And Wei Wu and I worked with devs on the Tablet team to develop a good international solution for the TabletPC's soft keyboard.
1 - The most visible UI I have ever created would have to be some of the new wizards I added to the huge collection of existing wizards in Access 97 and Access 2000. But MSKLC definitely picks up the silver medal.
2 - Although it is last on the list here, it is probably the most commonly used feature, and it highlighted the pattern of those weekly meetings. I would show the current state of the UI, Simon or Cathy would bring up a feature they felt was crucial, I would push back and explain why it was not feasible, they would grudgingly accept this, but the issues they brought up would keep bothering me until I thought of a way to make it feasible. Then I would show it to them the next week. I am pretty sure that was how the meeting became known as D&P in the first place....
This post sponsored by "" (U+e000, a.k.a. the first PRIVATE USE codepoint).It ought to be a square box most of the time!
Back in May of 2004, someone asked the following question in the newsgroups:
I'm programming in ASP.NET. How could I convert my date to UK format ?Thanks in advance.
To which someone else suggested the following code:
DateTime x=DateTime.Now;string s=x.ToString(System.Globalization.CultureInfo.CreateSpecificCulture("uk").DateTimeFormat);
To his credit, this code was compiled and ran; in the end he was convinced he had the solution.
However, there are many problems with this code:
So why did the code run, you may skeptically be thinking? Though probably not if you thought about the title of this post!
Well, it has to with the overlap of ISO 639 (the two letter language codes) and ISO 3166 (the two letter region codes). Or in his case, using the wrong abbreviation in the wrong method and having it find some random region that happens to use the abbreviation (in this case the Ukranian neutral locale was being created).
This is kinda unavoidable since
See the following table for a list of the overlaps. The bad overlaps where you will get wrong results are marked in red.
Code
Language
Region
ar
Arabic
Argentina
az
Azeri
Azerbaijan
be
Belarusian
Belgium
bg
Bulgarian
Bulgaria
ca
Catalan
Canada
de
German
Germany
es
Spanish
Spain
fi
Finnish
Finland
fo
Faroese
Faroe Islands
fr
French
France
hr
Croatian
Croatia
hu
Hungarian
Hungary
id
Indonesian
Indonesia
is
Icelandic
Iceland
it
Italian
Italy
lt
Lithuanian
Lithuania
lv
Latvian
Latvia
mk
Macedonian
FYROM
mn
Mongolian
Mongolia
nl
Dutch
The Netherlands
no
Norwegian
Norway
pa
Punjabi
Panama
pl
Polish
Poland
pt
Portuguese
Portugal
ro
Romanian
Romania
ru
Russian
Russia
sa
Sanskrit
Saudi Arabia
sk
Slovak
Slovakia
sv
Swedish
El Salvador
th
Thai
Thailand
tr
Turkish
Turkey
tt
Tatar
Trinidad and Tobago
uz
Uzbek
Uzbekistan
For the full lists of cultures and regions, see the CultureInfo and RegionInfo help topics.
This very non-bug has been reported internally by people wondering why creating a RegionInfo from a neutral (region-less) culture like "AR" was succeeding, as they were not thinking about how when you pass it to a RegionInfo you are not getting "Arabic" you are getting "Argentina".
Of course, this is just a symptom about a larger problem that affects international testing in general, which I will be talking about in a future post. Think of this post as describing the tip of the iceberg. :-)
1 - In this specific case the method would quite literally return the wrong results even if you passed the right language associated with the UK -- en, because the default culture returned from CreateSpecificCulture would be en-US, not en-GB.
This post sponsored by "o", "ο", and "о" (U+006f, U+03bf, and U+043e; a.k.a. LATIN SMALL LETTER O; GREEK SMALL LETTER OMICRON; CYRILLIC SMALL LETTER O).
At last, the longstanding problems with end user license agreement (EULA) for MSLU have been fixed. You can look at the text of the EULA here or you can get it by downloading MSLU here.
This new EULA meets the intent that our team has had for MSLU since it was first released back in July of 2001. I am not a lawyer, but in my unofficial, non-legally-binding opinion it certainly is consistent with the behavior of Microsoft during this whole period (since not even "case and desist" letter was sent out to anyone for "violating" the old EULA's points which were contentious).
The main problems boiled down to having the wrong boilerplate...
The old EULA had the standard language that Microsoft uses to cover products that can be downloaded by anyone who agrees with the EULA but whose components then cannot be separately redistributed without making the eventual end user agree to the EULA.
The new EULA has the standard language that Microsoft uses to cover products that can be downloaded by anyone who agrees with the EULA and then the specific components within the download can be redistributed more than once to an eventual end user as part of a product.
A good example of why the difference can be important would be if you are one of those lucky third parties whose code ships with Visual Studio. Say you wanted your component to run on Win9x so you wanted developers building setups to have MSLU redistributed with your runtime. In that case, MSLU would be with your component shipping with VS, it would be added to the setup packages of people using your component, and then their end users who install their application would get MSLU with your cool component.
The same rules apply to components that do not ship with Visual Studio, of course (and many large companies were worried about the old language because it seemed to contraindicate their intended usage of MSLU!).
The ability to do this sort of thing was always intended (and there was even a component that shipped with the first version of VS.NET which had this requirement!). It just took the EULA a while to catch up to the intent of the component. :-)
No Unicode code point was willing to sponsor this posting (Unicode characters, it would seem, are afraid of both lawyers and paralegals!)
END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE:
Microsoft Layer for Unicode on Windows 95, 98, and Me Systems,
Version No. 1.1.3790.0
IMPORTANT—READ CAREFULLY: This End-User License Agreement (“EULA”) is a legal agreement between you (either an individual or a single entity) and Microsoft Corporation for the Microsoft software product identified above, which includes computer software and may include associated media, printed materials, “online” or electronic documentation, and Internet-based services (“Product”). An amendment or addendum to this EULA may accompany the Product. YOU AGREE TO BE BOUND BY THE TERMS OF THIS EULA BY INSTALLING, COPYING, OR OTHERWISE USING THE PRODUCT. IF YOU DO NOT AGREE, DO NOT INSTALL, COPY, OR USE THE PRODUCT; YOU MAY RETURN IT TO YOUR PLACE OF PURCHASE FOR A FULL REFUND, IF APPLICABLE.
Software PRODUCT LICENSE
1. GRANTS OF LICENSE. Microsoft grants you the rights described in this EULA provided that you comply with all terms and conditions of this EULA.
1.1 General License Grant. You may install and use an unlimited number of copies of the Product on computers, including workstations, terminals or other digital electronic devices residing on your premises ("Computers") to design, develop, and test your software application(s) ("Licensee Products") for use with any version or edition of Microsoft Windows 95, Windows 98, Windows NT 4.0, Windows 2000 operating system products and/or any version or edition of any Microsoft operating system product that is a successor to the foregoing and/or any Microsoft product suite that contains any of the foregoing (each a "Microsoft Operating System).
1.2 Documentation. You may make and use an unlimited number of copies of any documentation, provided that such copies shall be used only for personal purposes and are not to be republished or distributed (either in hard copy or electronic form) beyond your premises.
1.3 Storage/Network Use. You may also store or install a copy of the Product on a storage device, such as a network server, used only to install or run the Product on computers used by a licensed end user in accordance with Section 1.1. A single license for the Product may not be shared or used concurrently by multiple end users.
2. ADDITIONAL LICENSE RIGHTS -- REDISTRIBUTABLE CODE. In addition to the rights granted in Section 1, certain portions of the Product, as described in this Section 2, are provided to you with additional license rights. These additional license rights are conditioned upon your compliance with the distribution requirements and license restrictions described in Section 3.
2.1 Sample Code. Microsoft grants you the right to use and modify the source code version of those portions of the Product identified as “Samples” in REDIST.TXT or elsewhere in the Product (“Sample Code”) for the sole purposes of designing, developing, and testing your product(s), and to reproduce and distribute the Sample Code, along with any modifications thereof, in object and/or source code form. For applicable redistribution requirements for Sample Code, see Section 3.1 below.
2.2 Redistributable Code—General. Microsoft grants you a nonexclusive, royalty-free right to reproduce and distribute the object code form of any portion of the Product listed in REDIST.TXT (“Redistributable Code”). For general redistribution requirements for Redistributable Code, see Section 3.1, below.
3. LICENSE RESTRICTIONS -- DISTRIBUTION REQUIREMENTS. If you choose to exercise your rights under Section 2, any redistribution by you is subject to your compliance with the following terms.
3.1 If you are authorized and choose to redistribute Sample Code, or Redistributable Code (collectively, the “Redistributables”) as described in Section 2, you agree: (i) except as otherwise noted in Section 2.1 (Sample Code), to distribute the Redistributables only in object code form and in conjunction with and as a part of the Licensee Products developed by you that adds significant and primary functionality to the Redistributables; (ii) that the Redistributables only operate in conjunction with Microsoft Windows platforms; (iii) to distribute the Licensee Product containing the Redistributables pursuant to an end user license agreement (which may be “break-the-seal”, “click-wrap” or signed), with terms no less protective than those contained in this EULA; (iv) not to use Microsoft’s name, logo, or trademarks to market the Licensee Product; (v) to display your own valid copyright notice which shall be sufficient to protect Microsoft’s copyright in the Product; (vi) not to remove or obscure any copyright, trademark or patent notices that appear on the Product as delivered to you; (vii) to indemnify, hold harmless, and defend Microsoft from and against any claims or lawsuits, including attorney’s fees, that arise or result from the use or distribution of the Licensee Product; (viii) otherwise comply with the terms of this EULA; and (ix) agree that Microsoft reserves all rights not expressly granted.
You also agree not to permit further distribution of the Redistributables by your end users except you may permit further redistribution of the Redistributables by your distributors to your end-user customers if your distributors only distribute the Redistributables in conjunction with, and as part of, the Licensee Product and you and your distributors comply with all other terms of this EULA.
3.2 If you use the Redistributables, then in addition to your compliance with the applicable distribution requirements described for the Redistributables, the following also applies. Your license rights to the Redistributables are conditioned upon your (i) not incorporating Identified Product into or combining Identified Product with the Redistributables or a derivative work thereof; (ii) not distributing Identified Product in conjunction with the Redistributables or a derivative work thereof; and (iii) not using Identified Product in the development of a derivative work of the Redistributables. “Identified Product” means Product which is licensed pursuant to terms that directly or indirectly (A) create, or purport to create, obligations for Microsoft with respect to the Redistributables or derivative work thereof or (B) grant, or purport to grant, to any third party any rights or immunities under Microsoft’s intellectual property or proprietary rights in the Redistributables or derivative work thereof. Identified Product includes, without limitation, any Product that requires as a condition of its use, modification and/or distribution, that any other Product incorporated into, derived from or distributed with such Product must also be (1) disclosed or distributed in source code form; (2) licensed for the purpose of making derivative works; or (3) redistributable at no charge.
4. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS
5. RESERVATION OF RIGHTS. Microsoft reserves all rights not expressly granted to you in this EULA.
6. UPGRADES. To use a Product identified as an upgrade, you must first be licensed for the product identified by Microsoft as eligible for the upgrade. After upgrading, you may no longer use the product that formed the basis for your upgrade eligibility.You may use the resulting upgraded product only in accordance with the terms of this EULA. If the Product is an upgrade of a component of a package of software programs that you licensed as a single product, the Product may be used and transferred only as part of that single product package and may not be separated for use by more than one end user.
7. DOWNGRADES. Instead of installing and using the Product, you may install and use one copy of an earlier version of the Product, provided that you completely remove such earlier version and install the original Product within a reasonable time. Your use of such earlier version shall be governed by this EULA, and your rights to use such earlier version shall terminate when you install the original Product.
8. LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY. You may not reverse engineer, decompile, or disassemble the Product, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
9. RENTAL. You may not rent, lease or lend the Product.
10. TRADEMARKS. This EULA does not grant you any rights in connection with any trademarks or service marks of Microsoft.
11. NOT FOR RESALE SOFTWARE. If the Product is labeled “Not For Resale” or “NFR,” then you may not resell, or otherwise transfer for value, the Product.
12. ACADEMIC EDITION SOFTWARE. To use Product identified as “Academic Edition” or “AE,” you must be a “Qualified Educational User.” For qualification-related questions, please contact the Microsoft Sales Information Center/One Microsoft Way/Redmond, WA 98052-6399 or the Microsoft subsidiary serving your country.
13. CONSENT TO USE OF DATA. You agree that Microsoft and its affiliates may collect and use technical information gathered as part of the product support services provided to you, if any, related to the Product. Microsoft may use this information solely to improve our products or to provide customized services or technologies to you and will not disclose this information in a form that personally identifies you.
14. LINKS TO THIRD PARTY SITES. You may link to third party sites through the use of the Product. The third party sites are not under the control of Microsoft, and Microsoft is not responsible for the contents of any third party sites, any links contained in third party sites, or any changes or updates to third party sites. Microsoft is not responsible for webcasting or any other form of transmission received from any third party sites. Microsoft is providing these links to third party sites to you only as a convenience, and the inclusion of any link does not imply an endorsement by Microsoft of the third party site.
15. U.S. GOVERNMENT LICENSE RIGHTS. All Product provided to the U.S. Government pursuant to solicitations issued on or after December 1, 1995 is provided with the commercial license rights and restrictions described elsewhere herein. All Product provided to the U.S. Government pursuant to solicitations issued prior to December 1, 1995 is provided with “Restricted Rights” as provided for in FAR, 48 CFR 52.227-14 (JUNE 1987) or DFAR, 48 CFR 252.227-7013 (OCT 1988), as applicable.
16. EXPORT RESTRICTIONS. You acknowledge that the Product is subject to U.S. export jurisdiction. You agree to comply with all applicable international and national laws that apply to the Product, including the U.S. Export Administration Regulations, as well as end-user, end-use, and destination restrictions issued by U.S. and other governments. For additional information see <http://www.microsoft.com/exporting/>.
17. ADDITIONAL SOFTWARE/SERVICES. This EULA applies to updates, supplements, add-on components, or Internet-based services components, of the Product that Microsoft may provide to you or make available to you after the date you obtain your initial copy of the Product, unless we provide other terms along with the update, supplement, add-on component, or Internet-based services component. Microsoft reserves the right to discontinue any Internet-based services provided to you or made available to you through the use of the Product.
18. SOFTWARE TRANSFER. The initial user of the Product may make a one-time permanent transfer of this EULA and Product to another end user. This transfer must include all of the Product (including all component parts, the media and printed materials, any upgrades, this EULA, and, if applicable, the Certificate of Authenticity). The transfer may not be an indirect transfer, such as a consignment. Prior to the transfer, the end user receiving the Software must agree to all the EULA terms.
19. TERMINATION. Without prejudice to any other rights, Microsoft may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the Product and all of its component parts.
20. APPLICABLE LAW. If you acquired this Product in the United States, this EULA is governed by the laws of the State of Washington. If you acquired this Product in Canada, unless expressly prohibited by local law, this EULA is governed by the laws in force in the Province of Ontario, Canada; and, in respect of any dispute which may arise hereunder, you consent to the jurisdiction of the federal and provincial courts sitting in Toronto, Ontario. If this Product was acquired outside the United States, then local law may apply.
21. The Product is protected by copyright and other intellectual property laws and treaties. Microsoft or its suppliers own the title, copyright, and other intellectual property rights in the Product. The Product is licensed, not sold.
22. LIMITED WARRANTY FOR PRODUCT ACQUIRED IN THE US AND CANADA.
Except with respect to the Redistributables, which are provided “AS IS,” without warranty of any kind, Microsoft warrants that the Product will perform substantially in accordance with the accompanying materials for a period of ninety days from the date of receipt.
If an implied warranty or condition is created by your state/jurisdiction and federal or state/provincial law prohibits disclaimer of it, you also have an implied warranty or condition, BUT ONLY AS TO DEFECTS DISCOVERED DURING THE PERIOD OF THIS LIMITED WARRANTY (NINETY DAYS). AS TO ANY DEFECTS DISCOVERED AFTER THE NINETY (90) DAY PERIOD, THERE IS NO WARRANTY OR CONDITION OF ANY KIND. Some states/jurisdictions do not allow limitations on how long an implied warranty or condition lasts, so the above limitation may not apply to you.
Any supplements or updates to the Product, including without limitation, any (if any) service packs or hot fixes provided to you after the expiration of the ninety day Limited Warranty period are not covered by any warranty or condition, express, implied or statutory.
LIMITATION ON REMEDIES; NO CONSEQUENTIAL OR OTHER DAMAGES. Your exclusive remedy for any breach of this Limited Warranty is as set forth below. Except for any refund elected by Microsoft, YOU ARE NOT ENTITLED TO ANY DAMAGES, INCLUDING BUT NOT LIMITED TO CONSEQUENTIAL DAMAGES, if the Product does not meet Microsoft’s Limited Warranty, and, to the maximum extent allowed by applicable law, even if any remedy fails of its essential purpose. The terms of Section 25 below (“Exclusion of Incidental, Consequential and Certain Other Damages”) are also incorporated into this Limited Warranty. Some states/jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to you. This Limited Warranty gives you specific legal rights. You may have others which vary from state/jurisdiction to state/jurisdiction. YOUR EXCLUSIVE REMEDY. Microsoft’s and its suppliers’ entire liability and your exclusive remedy shall be, at Microsoft’s option from time to time exercised subject to applicable law, (a) return of the price paid (if any) for the Product, or (b) repair or replacement of the Product, that does not meet this Limited Warranty and that is returned to Microsoft with a copy of your receipt. You will receive the remedy elected by Microsoft without charge, except that you are responsible for any expenses you may incur (e.g. cost of shipping the Product to Microsoft). This Limited Warranty is void if failure of the Product has resulted from accident, abuse, misapplication, abnormal use or a virus. Any replacement Product will be warranted for the remainder of the original warranty period or thirty (30) days, whichever is longer. Outside the United States or Canada, neither these remedies nor any product support services offered by Microsoft are available without proof of purchase from an authorized international source. To exercise your remedy, contact: Microsoft, Attn. Microsoft Sales Information Center/One Microsoft Way/Redmond, WA 98052-6399, or the Microsoft subsidiary serving your country. LIMITED WARRANTY FOR PRODUCT ACQUIRED OUTSIDE THE US or CANADA. FOR THE LIMITED WARRANTIES AND SPECIAL PROVISIONS PERTAINING TO YOUR PARTICULAR JURISDICTION, PLEASE REFER TO YOUR WARRANTY BOOKLET INCLUDED WITH THIS PACKAGE OR PROVIDED WITH THE SOFTWARE PRODUCT PRINTED MATERIALS.
23. DISCLAIMER OF WARRANTIES. The Limited Warranty that appears above is the only express warranty made to you and is provided in lieu of any other express warranties (if any) created by any documentation, packaging, or other communications. Except for the Limited Warranty and to the maximum extent permitted by applicable law, Microsoft and its suppliers provide the Product and support services (if any) AS IS AND WITH ALL FAULTS, and hereby disclaim all other warranties and conditions, either express, implied or statutory, including, but not limited to, any (if any) implied warranties, duties or conditions of merchantability, of fitness for a particular purpose, of reliability or availability, of accuracy or completeness of responses, of results, of workmanlike effort, of lack of viruses, and of lack of negligence, all with regard to the Product, and the provision of or failure to provide support or other services, information, software, and related content through the Product or otherwise arising out of the use of the Product. ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE PRODUCT.
24. EXCLUSION OF INCIDENTAL, CONSEQUENTIAL AND CERTAIN OTHER DAMAGES. To the maximum extent permitted by applicable law, in no event shall Microsoft or its suppliers be liable for any special, incidental, punitive, indirect, or consequential damages whatsoever (including, but not limited to, damages for loss of profits or confidential or other information, for business interruption, for personal injury, for loss of privacy, for failure to meet any duty including of good faith or of reasonable care, for negligence, and for any other pecuniary or other loss whatsoever) arising out of or in any way related to the use of or inability to use the PRODUCT, the provision of or failure to provide Support OR OTHER Services, informaton, software, and related CONTENT through the product or otherwise arising out of the use of the product, or otherwise under or in connection with any provision of this EULA, even in the event of the fault, tort (including negligence), strict liability, breach of contract or breach of warranty of Microsoft or any supplier, and even if Microsoft or any supplier has been advised of the possibility of such damages.
25. LIMITATION OF LIABILITY AND REMEDIES. Notwithstanding any damages that you might incur for any reason whatsoever (including, without limitation, all damages referenced above and all direct or general damages), the entire liability of Microsoft and any of its suppliers under any provision of this EULA and your exclusive remedy for all of the foregoing (except for any remedy of repair or replacement elected by Microsoft with respect to any breach of the Limited Warranty) shall be limited to the greater of the amount actually paid by you for the Product or U.S.$5.00. The foregoing limitations, exclusions and disclaimers (including Sections 22, 23, and 24 above) shall apply to the maximum extent permitted by applicable law, even if any remedy fails its essential purpose.
26. ENTIRE AGREEMENT. This EULA (including any addendum or amendment to this EULA which is included with the Product) are the entire agreement between you and Microsoft relating to the Product and the support services (if any) and they supersede all prior or contemporaneous oral or written communications, proposals and representations with respect to the Product or any other subject matter covered by this EULA. To the extent the terms of any Microsoft policies or programs for support services conflict with the terms of this EULA, the terms of this EULA shall control.
Si vous avez acquis votre produit Microsoft au CANADA, la garantie limitée suivante vous concerne :
GARANTIE LIMITÉE
Sauf pur celles du “Redistributables,” qui sont fournies “comme telles,” Microsoft garantit que le Produit fonctionnera conformément aux documents inclus pendant une période de 90 jours suivant la date de réception.
Si une garantie ou condition implicite est créée par votre État ou votre territoire et qu’une loi fédérale ou provinciale ou État en interdit le déni, vous jouissez également d’une garantie ou condition implicite, MAIS UNIQUEMENT POUR LES DÉFAUTS DÉCOUVERTS DURANT LA PÉRIODE DE LA PRÉSENTE GARANTIE LIMITÉE (QUATRE-VINGT-DIX JOURS). IL N’Y A AUCUNE GARANTIE OU CONDITION DE QUELQUE NATURE QUE CE SOIT QUANT AUX DÉFAUTS DÉCOUVERTS APRÈS CETTE PÉRIODE DE QUATRE-VINGT-DIX JOURS. Certains États ou territoires ne permettent pas de limiter la durée d’une garantie ou condition implicite de sorte que la limitation cidessus peut ne pas s’appliquer à vous.
Tous les suppléments ou toutes les mises à jour relatifs au Produit, notamment, les ensembles de services ou les réparations à chaud (le cas échéant) qui vous sont fournis après l’expiration de la période de quatre-vingt-dix jours de la garantie limitée ne sont pas couverts par quelque garantie ou condition que ce soit, expresse ou implicite.
LIMITATION DES RECOURS; ABSENCE DE DOMMAGES INDIRECTS OU AUTRES. Votre recours exclusif pour toute violation de la présente garantie limitée est décrit ciaprès. Sauf pour tout remboursement au choix de Microsoft, si le Produit ne respecte pas la garantie limitée de Microsoft et, dans la mesure maximale permise par les lois applicables, même si tout recours n’atteint pas son but essentiel, VOUS N’AVEZ DROIT À AUCUNS DOMMAGES, NOTAMMENT DES DOMMAGES INDIRECTS. Les modalités de la clause «Exclusion des dommages accessoires, indirects et de certains autres dommages » sont également intégrées à la présente garantie limitée. Certains États ou territoires ne permettent pas l’exclusion ou la limitation des dommages indirects ou accessoires de sorte que la limitation ou l’exclusion cidessus peut ne pas s’appliquer à vous. La présente garantie limitée vous donne des droits légaux spécifiques. Vous pouvez avoir d’autres droits qui peuvent varier d’un territoire ou d’un État à un autre. VOTRE RECOURS EXCLUSIF. L’obligation intégrale de Microsoft et de ses fournisseurs et votre recours exclusif seront, selon le choix de Microsoft de temps à autre sous réserve de toute loi applicable, a) le remboursement du prix payé, le cas échéant, pour le Produit ou b) la réparation ou le remplacement du Produit qui ne respecte pas la présente garantie limitée et qui est retourné à Microsoft avec une copie de votre reçu. Vous recevrez la compensation choisie par Microsoft, sans frais, sauf que vous êtes responsable des dépenses que vous pourriez engager (p. ex., les frais d’envoi du Produit à Microsoft). La présente garantie limitée est nulle si la défectuosité du Produit est causée par un accident, un usage abusif, une mauvaise application, un usage anormal ou un virus. Tout Produit de remplacement sera garanti pour le reste de la période de garantie initiale ou pendant trente (30) jours, selon la plus longue entre ces deux périodes. À l’extérieur des États-Unis ou du Canada, ces recours ou l’un quelconque des services de soutien technique offerts par Microsoft ne sont pas disponibles sans preuve d’achat d’une source internationale autorisée. Pour exercer votre recours, vous devez communiquer avec Microsoft et vous adresser au Microsoft Sales Information Center/One Microsoft Way/Redmond, WA 98052-6399, ou à la filiale de Microsoft de votre pays.
DÉNI DE GARANTIES. La garantie limitée mentionnée ci-dessus constitue la seule garantie expresse qui vous est donnée et remplace toutes autres garanties expresses (s’il en est) mentionnées dans un document ou sur un emballage. Sauf en ce qui a trait à la garantie limitée et dans la mesure maximale permise par les lois applicables, le Produit et les services de soutien technique (le cas échéant) sont fournis TELS QUELS ET AVEC TOUS LES DÉFAUTS par Microsoft et ses fournisseurs, lesquels par les présentes dénient toutes autres garanties et conditions expresses, implicites ou en vertu de la loi, notamment (le cas échéant) les garanties, devoirs ou conditions implicites de qualité marchande, d’adaptation à un usage particulier, d’exactitude ou d’exhaustivité des réponses, des résultats, des efforts déployés selon les règles de l’art, d’absence de virus et de négligence, le tout à l’égard du Produit et de la prestation des services de soutien technique ou de l’omission d’une telle prestation. PAR AILLEURS, IL N’Y A AUCUNE GARANTIE OU CONDITION QUANT AU TITRE DE PROPRIÉTÉ, À LA JOUISSANCE OU LA POSSESSION PAISIBLE, À LA CONCORDANCE À UNE DESCRIPTION NI QUANT À UNE ABSENCE DE CONTREFAÇON CONCERNANT LE PRODUIT.
EXCLUSION DES DOMMAGES ACCESSOIRES, INDIRECTS ET DE CERTAINS AUTRES DOMMAGES. DANS LA MESURE MAXIMALE PERMISE PAR LES LOIS APPLICABLES, EN AUCUN CAS MICROSOFT OU SES FOURNISSEURS NE SERONT RESPONSABLES DES DOMMAGES SPÉCIAUX, CONSÉCUTIFS, ACCESSOIRES OU INDIRECTS DE QUELQUE NATURE QUE CE SOIT (NOTAMMENT, LES DOMMAGES À L’ÉGARD DU MANQUE À GAGNER OU DE LA DIVULGATION DE RENSEIGNEMENTS CONFIDENTIELS OU AUTRES, DE LA PERTE D’EXPLOITATION, DE BLESSURES CORPORELLES, DE LA VIOLATION DE LA VIE PRIVÉE, DE L’OMISSION DE REMPLIR TOUT DEVOIR, Y COMPRIS D’AGIR DE BONNE FOI OU D’EXERCER UN SOIN RAISONNABLE, DE LA NÉGLIGENCE ET DE TOUTE AUTRE PERTE PÉCUNIAIRE OU AUTRE PERTE DE QUELQUE NATURE QUE CE SOIT) SE RAPPORTANT DE QUELQUE MANIÈRE QUE CE SOIT À L’UTILISATION DU PRODUIT OU À L’INCAPACITÉ DE S’EN SERVIR, À LA PRESTATION OU À L’OMISSION D’UNE TELLE PRESTATION DE SERVICES DE SOUTIEN TECHNIQUE OU AUTREMENT AUX TERMES DE TOUTE DISPOSITION DU PRÉSENT EULA OU RELATIVEMENT À UNE TELLE DISPOSITION, MÊME EN CAS DE FAUTE, DE DÉLIT CIVIL (Y COMPRIS LA NÉGLIGENCE), DE RESPONSABILITÉ STRICTE, DE VIOLATION DE CONTRAT OU DE VIOLATION DE GARANTIE DE MICROSOFT OU DE TOUT FOURNISSEUR ET MÊME SI MICROSOFT OU TOUT FOURNISSEUR A ÉTÉ AVISÉ DE LA POSSIBILITÉ DE TELS DOMMAGES.
LIMITATION DE RESPONSABILITÉ ET RECOURS. Malgré les dommages que vous puissiez subir pour quelque motif que ce soit (notamment, tous les dommages susmentionnés et tous les dommages directs ou généraux), l’obligation intégrale de Microsoft et de l’un ou l’autre de ses fournisseurs aux termes de toute disposition du présent EULA et votre recours exclusif à l’égard de tout ce qui précède (sauf en ce qui concerne tout recours de réparation ou de remplacement choisi par Microsoft à l’égard de tout manquement à la garantie limitée) se limite au plus élevé entre les montants suivants : le montant que vous avez réellement payé pour le Produit ou 5,00 $US. Les limites, exclusions et dénis qui précèdent (y compris les clauses ci-dessus), s’appliquent dans la mesure maximale permise par les lois applicables, même si tout recours n’atteint pas son but essentiel.
La présente Convention est régie par les lois de la province d’Ontario, Canada. Chacune des parties à la présente reconnaît irrévocablement la compétence des tribunaux de la province d’Ontario et consent à instituer tout litige qui pourrait découler de la présente auprès des tribunaux situés dans le district judiciaire de York, province d’Ontario.
Au cas où vous auriez des questions concernant cette licence ou que vous désiriez vous mettre en rapport avec Microsoft pour quelque raison que ce soit, veuillez contacter la succursale Microsoft desservant votre pays, dont l’adresse est fournie dans ce produit, ou écrivez à : Microsoft Sales Information Center, One Microsoft Way, Redmond, Washington 98052-6399.
Believe it or not, I have gotten this question with language as bad as (and often worse than!) the title line of this post.
The quick answer, as I am sure might have guessed, is no. :-)
For the longer answer, I'll go to the FAQ section of the white paper Cathy Wissink and I wrote for a presentation1 entitled Unicode and Keyboards on Windows at IUC25 in Washington, D.C. in March of 2004:
Q - "I get the feeling Microsoft just makes up these keyboards by themselves. Why don’t they represent my language the way I expect them to?" A - New keyboards for a market always get tested in their respective market. A great deal of research does go into the keyboards shipped with the system, with feedback from linguists, government officials, other internationalization experts, and local software providers. Often it is the case of Becker’s law applying (that is, for each expert, there is an equal and opposite expert), unfortunately.
Q - "I get the feeling Microsoft just makes up these keyboards by themselves. Why don’t they represent my language the way I expect them to?"
A - New keyboards for a market always get tested in their respective market. A great deal of research does go into the keyboards shipped with the system, with feedback from linguists, government officials, other internationalization experts, and local software providers. Often it is the case of Becker’s law applying (that is, for each expert, there is an equal and opposite expert), unfortunately.
Another form of the question which was much more polite came from Serge Wautier on this blog:
Why are there that many keyboard layouts ? Why a french belgian layout where only a couple of non-alphanumeric characters are layed out differently from the french layout ? My feeling - I am a french speaking belgian - is that the only goal reached is pure confusion. I have yet to understand why belgian people would prefer the \ as Ctrl + Alt + < rather than Ctrl + Alt + 8 (and vice versa).
Why are there that many keyboard layouts ?
Why a french belgian layout where only a couple of non-alphanumeric characters are layed out differently from the french layout ? My feeling - I am a french speaking belgian - is that the only goal reached is pure confusion. I have yet to understand why belgian people would prefer the \ as Ctrl + Alt + < rather than Ctrl + Alt + 8 (and vice versa).
The above answer covers the reasons -- because somebody somewhere noted the difference between them. And while this can be confusing, the sad truth is that for every customer who would rather see fewer layouts to avoid confusion, there are six customers who want new layouts added to match their expectations.
But with that said, Serge's question can get an even better answer!
When you add keyboard layouts through the Regional Options control panel applet, you explicitly choose a language and a keyboard layout. So any time you prefer another layout, you can pick your language with this alternate selection.
And of course any time you do not like any layout provided by Windows, you can make your own with MSKLC!
1 - This presentation, which appeared to be a boring talk about keyboards from the description actually turned out to be where we announced the release of MSKLC, thus continuing a bold tradition that Cathy and I started in our IUC18 talk Unicode on Downlevel Windows (when we did the surprise announcement of MSLU). In talking to people after the keyboard talk about why they stayed to see the last talk of the day given its somewhat dry description (the room was very busy), I had two different people tell me that they knew that we would be announcing something because when we cover stuff that appears like it will be boring, we always have something up our sleeves!
This post brought to you by "๒" (U+0e52, a.k.a. THAI DIGIT TWO)
One of the 14 people who read this blog was reading my recent post "How do sort keys work?" and he thought that he may have found a bug. He didn't, but it was an interesting point that he brought up. So I thought I'd mention it here.
(Note to all -- never be afraid to post a comment, neither bugs nor mistakes will ever embarass me!)
His question, and the answer, follow below.
Your post and the Platform SDK list a specific format for sort keys [all Unicode sort weights] 0x01 [all Diacritic weights] 0x01 [all Case weights] 0x01 [all Special weights] 0x00 But using a single 0x01 byte to separate the different weights seems very dangerous. Couldn't somebody accidentally pick a string that happens to have a single byte in one of the weights that would mimic this section ending marker? This could cause two strings to be considered equal even if they are not, couldn't it?
Your post and the Platform SDK list a specific format for sort keys
[all Unicode sort weights] 0x01 [all Diacritic weights] 0x01 [all Case weights] 0x01 [all Special weights] 0x00
But using a single 0x01 byte to separate the different weights seems very dangerous. Couldn't somebody accidentally pick a string that happens to have a single byte in one of the weights that would mimic this section ending marker? This could cause two strings to be considered equal even if they are not, couldn't it?
It is a very good question, but the answer is (thankfully) that it is not possible to hit that situation. The rules for the byte values in the sort key data we provide are such that we never allow a byte with only 0x01 in it. This was the only way we could make sure to always have an unambiguous section terminating marker.
This is obviously a tough loss. When you only have 256 possible values in each of those bytes, it is expensive to lose one of them (well, actually you lose two since we cannot allow the 0 either!). But its obviously required or else we would hit the very potential bugs that occurred to you....
This post sponsored by "" (U+0001, a.k.a. <control>, a.k.a. START OF HEADING)Note that this control shouldn't really look like much of anything except maybe accidentally a graphical block character on some versions of Windows -- he just did not think he'd have another chance to be relevant!)
The title for this post actually comes from the SortKey help topic:
Each character in a string is given several categories of sort weights, including script, alphabetic, case, and diacritic weights. A sort key serves as the repository of these weights for a particular string. For example, a sort key might contain a string of alphabetic weights, followed by a string of case weights, and so on. SortKey is equivalent to the Windows API method LCMapString with the LCMAP_SORTKEY flag. However, unlike LCMapString, the sort keys for English characters precede the sort keys for Korean characters.
Someone asked me what the hell that text refers to!
Well, a decision was made back in the early days of Windows (that incidentally many have had cause to regret) to cause ideographs for Korean to be sorted in front of all of the other letters (including the Latin script letters of English). This code exists on all of the Windows NT-based platforms and on the Windows CE platforms, but when the time came to support sort keys on the .NET Framework a decision was made to explicitly not do this.
There is no real linguistic basis for either behavior, its arbitrary either way.
Though since the .NET Compact Framework uses the WinCE OS tables to do its work, it means that the WinCE results will differ from the .NET Framework everywhere else.
It is worth mentioning that text in the SortKey topic is a little confusing since it does not make clear that this only happens for the Korean LCID. And since the Windows behavior is not completely documented it does not cover the fact that neither Extension A nor Extension B ideographs are supported by it (though at present none of them are given intentional Korean-specific weight, a fact that will change in future versions).
In any case, thats why Korean has the Korean coming first. Though when you consider the fact that this affects over 20,000 ideographs, the image of someone asking if they could cut in line at the supermarket "because they only have 20,000 items" is a little scary. :-)
This post brought to you by "ᇴ" (U+11f4, a.k.a. HANGUL JONGSEONG KAPYEOUNPHIEUPH)
A few months ago, I was talking with a customer who simply could not understand the sorting results she was seeing (in this case in a table in MS Word 2003). She distilled it down to a small repro; basically she took a small list of words:
word
meaning
cote
dimension
côte
coast
coté
with dimensions
côté
side
(at this point I knew both the language and what was causing her to have problems, and you may know too!)
What she noticed was that if she marked the left column as being French text (she tried several French choices, including France and Canada), the order was like this:
while if column was marked as being English then the results looked like this:
She could not understand any sorting rules that would explain the way that the words were sorting in the "French" table.
So I talked with her about Académie française and how they have a specific preference related to the way letters with diacritics are to be sorted (I also mentioned incidentally that I thought they had abolished the use of the circumflex in the early 1990's in many words but honestly I did not know if it applied to these two words that use the SMALL O WITH CIRCUMFLEX!).
The specific rule I was talking about here is that diacritics are evaluated from right to left rather than from left to right. Thus côte comes before coté, rather than after it as it does in languages like English that evaluate them from left to right. Because the word côte has no ACUTE on the "e" at the end of the word while coté does. In English and most other languages, the evaluation starts on the left and therefore the CIRCUMFLEX or lack thereof on the "o" is the controlling factor in ordering.
You can see it described in the French sort order exanple in Appendix D of the first edition of Developing International Software for Windows 95 and Windows NT.
This particular rule is interesting in that in all of the native French speakers with whom I have spoken, I never found anyone who could explain the rule to me. In their defense they were pretty much all aware that there were special rules used in dictionaries, but if you think about it there would seldom be a time that one could not find the word one wanted in a dictionary that used this rule. After living with the language for a lifetime, I am sure things like this are simply understood subconsciously when they occur. This phenomenon is common in almost all languages and they pretty much all have rules that native speakers understand even if the speakers cannot articulate the rules.
Another interesting factoid about language that can be seen here has to do with the fact that this use of "reverse diacritics" is seen in every French locale supported by Windows. It is fascinating to see the influence that the "mother country" of a language can sometimes have on changes that are made to other places where it is spoken.
When changes are made, whether by longtime organizations such as the Académie or by direct legislation, other countries will in many cases tend to pick up those changes. To me, the reasons behind such language reforms spreading this way are fascinating to contemplate. It is certainly not any kind of sovereignty or true languge "ownership" issue (and in future posts I may discuss specific cases in other languages where changes were at times intentionally not picked up!).
But I am at times amazed at the way that people will appear to see language as transcending the petty things. Its the kind of behavior that makes me interested in linguistic issues. :-)
This post brought to you by
I have been noticing more and more web sites lately that contain an interesting type of ad. Have you seen any of the following?
In each of these you are playing a game where you are given an "easy" task (provided you don't believe that Pamela Anderson is a pop diva, of course!). All you have to do is click in a specific small area of the screen making up a small part of an image that is not in the tab index, has no accelerator, has no other keyboard access, and is thus generally unreachable to people who have accessibility issues and are unable to use the mouse.
I must admit that there is a part of me that gets mad any time I see inaccessible UI. Its unfair, its thoughtless, and it discrimates. It sucks.
I am also forced to admit that there is another, larger part of me that is a little jealous of people who can be spared the stupidity of these ads. Its almost like someone is saying to them "I know you have it tough, so we won't force you to deal with the pop-up hell our company wants to give everyone else on the web dumb enough to click here."
All of that is probably crap -- if the lifeless wingnuts who design these Beelzebub's hors d'oeuvres and serve them up on web sites that are so desperate to have the Internet make some money for them finally that they will pimp for the video game system target practice contests were to recognize that there was a whole crowd of suckers who would give them money, then they'd be packaging up a system to deliver the con to them.
Luckily they do not seem to be all too bright.
A Sort key is basically an array of bytes. The intention of the sort key is to make for faster comparisons of strings, so that if you compare the sort key values for two strings you will get the same results as comparing the strings themselves. They abstract out all of the irrelevant data (for example if you use NORM_IGNORECASE or CompareOptions.IgnoreCase) then the binary sort key for "AAAA", "AaAa", and "aaaa" will all be identical. As such, sort keys make a great basis for an index of string values, like you would have in a database engine.
But how are they structured to allow this to happen?
They have the same architecture in both managed code (via the SortKey class) and unmanaged code (via LCMapString with the LCMAP_SORTKEY flag). The structure is described in the LCMapString topic in the Platform SDK:
[all Unicode sort weights] 0x01 [all Diacritic weights] 0x01 [all Case weights] 0x01 [all Special weights] 0x00 Note that the sort key is null-terminated. This is true regardless of the value of cchSrc. Also note that, even if some of the sort weights are absent from the sort key, due to the presence of one or more ignore flags in dwMapFlags, the 0x01 separators and the 0x00 terminator are still present.
Note that the sort key is null-terminated. This is true regardless of the value of cchSrc. Also note that, even if some of the sort weights are absent from the sort key, due to the presence of one or more ignore flags in dwMapFlags, the 0x01 separators and the 0x00 terminator are still present.
The reason for this structure is that the primary weights (called the Unicode weights, above) need to take priority over secondary weights (called Diacritic weights, above), which themselves have to take priority over the tertiary weights (called Case weights, above), and so forth. In this way, all of the following examples are true when using the invariant locale/culture, as described in the last post:
AAAA < AAAB (primary difference)AAAA < AÃAA (secondary difference)aaaa < AAAA (tertiary difference)AÃAA < AAAB (primary difference, secondary difference ignored)AAAA < aaaB (primary difference, tertiary difference ignored)aaaaab < aaab (primary difference, length and tertiary difference ignored)AAA < aaà (secondary difference, special width and tertiary difference ignored)
And so forth. For that to work, the four different categories need to be kept separate and each one needs to be put in the sort key in its entirety, and if any type of weight is ignored then that whole section will be empty.
You can take the sort key, this structured array of bytes, and use it as an index for the string. Comparisons of two byte arrays will always be faster than comparing the string themselves.
This of course assumes that the sort keys are pre-calculated, like in an index. If they are not and you are looking at the difference between caculating then comparing the sort key values for two strings versus comparing the strings themselves, the string comparison will almost certainly be faster. The reason for that is that the sort key calculation involves analyzing the information of the entire string (and still does not include the actual comparison) whereas string comparisons will exit as soon as they can come up with an answer to the question of which one comes first.
I was doing a presentation a few years ago and it occurred to me that looking at direct string comparison versus sort key calculation/comparison was like looking at the "retail" version of collation vs. the "Wholesale" one. Only some people in the crowd felt it was an illuminating analogy, and I once again learned that I should not blurt out "good ideas thst suddenly occur to me" when I am in the middle of a presentation. :-)
One last thought -- no, there is not an Ordinal type of sort key. Because Ordinal comparisons are already done in a binary manner!
This post brought to you by "р" (U+0440, a.k.a. CYRILLIC SMALL LETTER ER)
There is a great deal of confusion surrounding the meaning of these two different things in the .NET Framework, and when to use each. If you have suffered, are suffering, or think may suffer in the future from such a confusion, then read on!
(Otherwise, I guess you can go away and come back another time)
The invariant culture's direct ancestor is the invariant locale. Officially added to the Windows source tree at 10:23am on May 12, 2001, its intention was not to be used as an actual locale (which would explain why no locale data was added until a month later; until then no one was using it in GetLocaleInfo!).
Originally, LOCALE_INVARIANT had just one noble purpose -- to allow one to use CompareString (and LCMapString with the LCMAP_SORTKEY flag) in a way that would only use the "Default" Windows sorting table as mentioned a little bit here and especially here. The results, as that second article mentioned, would not vary when the user or system locale settings did; they would be invariant within that installation of Windows.
The data was added for this locale a month later, as I said, for obvious reasons -- if you have an LCID that one function considers to be valid, you must have a very good reason if another will not. And it cannot duplicate any other locale, either. Much weird data was added so that no one would be tempted to try to act like they spoke a language called "Invariant" and then all was good.
Note that these string comparisons still had much linguistic value -- half of the locales in Windows use that default table, so an invariant sort would not only avoid varying, it would also look right to a lot of the world.
The .NET framework had similar requirements (with the additional need for invariant parsing/formatting support) and thus CultureInfo.InvariantCulture was created. As with the locale, any string comparions made with InvariantCulture's CompareInfo object would have linguistic validity in a lot of places, and would not vary within that installation of the .NET Framework.
So everyone had what they needed, right?
Well, no.
A bunch of people wanted a method of doing a more binary type of comparison, instead of one that would be based on the "linguistically appropriate" approach gven a particular culture1.
The difference between what we had and what they wanted was akin to the difference between the C Runtime's strcoll/wcscoll versus strcmp/wcscmp (in the CRT documentation they refer to the difference as being locale based versus lexicographic).
The other advantage to such a "lexicographic" comparison is that it would be faster since a simple binary comparison of the code point values was being used.
To meet this need, the notion of an Ordinal sort was added and an Ordinal member was added to the CompareOptions enumeration. Selecting it would ignore all of those cultural collation features and give you a binary sort that would also, incidentally, not vary.
The only remaining problem at this point is that there were now two useful ways to do these different "niche" type of comparisons but neither name really jumps out at the developers who were looking for such solutions.
That problem remains to this day, though every single time I speak at a conference or answer a question in a newsgroup or get someone to look at posts like this one, then there is at least one less developer who has this problem. Maybe this time it is you? :-)
Now the story does not end here; many people have wanted to do things in a case-insensitive way. Of course if you wanted a case-insensitive invariant comparison then you could have done that all along -- just use the InvariantCulture's CompareInfo methods with the CompareOptions.IgnoreCase flag passed in. Easy!
But some people wanted a case-insensitive ordinal comparison?!?
Now the closet linguist in me shudders at this concept since a casing operation is essentially a linguistic one while an ordinal one is specifically not -- it's lexicographic.
So people are asking for a linguistic non-linguistic support, a request that for me brings to mind the comedian Steven Wright's dog2.
However, the technical half of me understands the need and so I got over my linguistic fetish as one of my colleagues on the BCL team worked in Whidbey to add a new OrdinalIgnoreCase member to the CompareOptions enumeration.
The behavior is basically to do the casing operation using the default casing tables prior to doing the binary comparison. This feature has been in the "Whidbey" version of the .NET Framework for some time (first checked into the source code tree on February 7, 2003), so you can try it out today if you have just about any build of Whidbey underfoot.
Hopefully this post will help clear up some of the confusion about these two interesting comparison types.
1 - What can I say? Some people are Некультурные (uncultured) though not in the culturally offensive sense.2 - Steven Wright claimed to have named his dog Stay so that he could call out "Come here, Stay! Come here, Stay!" and watch the dog walk toward him in a stuttery fashion.
This post brought to you by "Ω" (U+03a9, GREEK CAPITAL LETTER OMEGA)I talked to Omega just before this post went live. She said that as the last letter in the Greek alphabet (who was pretty much always therefore last in the queue), she understood the cost of keeping letters in order. Any performance benefit is good one, to her mind. Especially since a binary sort would let her come before her little sister (U+03c9, GREEK SMALL LETTER OMEGA) for once.
My New Year's Resolutions for 2005:
People who know me will affirm that I was doing this stuff already -- so it should be easy to keep doing it. :-)
This post brought to you by "F" (U+0046, LATIN CAPITAL LETTER F)I will not attempt to guess why the letter F would want to sponsor here, but he seemed to feel it was fairly important.
I am going to take these two questions out of order because (a) locales existed before cultures did, (b) neutral locales set the stage for neutral cultures, and (c) I think it may help us look less lame. Though that third reason is probably just naive optimism on my part....
To see what Windows does with neutral locales, you can look at the documented behavior of ConvertDefaultLocale. Basically, if you pass a neutral like LANG_ENGLISH then it will return the equivalent of MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT) thus 0x009 becomes 0x0409, 0x01a becomes 0x041a, and so forth. Easy, huh?
This ConvertDefaultLocale function calls an internal routine to do its work; the same routine is called by every NLS function, too. Which is a long way around to say that neutral locales do not exist to the Win32 NLS APIs.
Now there is one use for them in Win32 -- resource loading. You can use neutral LCIDs either to more accurately tag resources or to provide an easy fallback mechanism. Of course, if you want to put names on them then you cannot use GetLocaleInfo since asking for the LOCALE_SLANGUAGE of LANG_ENGLISH will give you "English (United States)" which is probably not what you wanted.
(In fact, I wonder what Visual Studio's resource editor does for its strings for these neutrals -- it must have its own strings somewhere, hard coded? Ick!)
In retrospect, it might have been a better idea to not do things that way, but it has shipped this way for at least the last ten versions of Windows. So we are kinda stuck with it.
Anyway, thats neutral locales -- at best, they are tolerated. But you can't really do much with them. Using that ConvertDefaultLocale-ish behavior can actually get you unexpected results sometimes, too. More on this another day.
This brings us to neutral cultures....
In the .NET Framework, a neutral CultureInfo mostly does not do this weird implied LCID fallback thing. There is actual data behind these culures that you can query and use -- and you can get back the actual names and everything. It also does a great job on the resource loading fallback -- using the CultureInfo object's Parent property. The parent property is not based on LCID tricks, either -- it's actual planned data for each culture. Obviously much cooler and a bit more thought out.There is even a CreateSpecificCulture method on a CultureInfo that does the same sort of thing as ConvertDefaultLocale, creating a specific culture from a neutral one.
A lot of you probably noticed where I said "mostly" in that last paragraph (an occupational hazard of having readers who can be as cynical as I am!). Unfortunately, that weird LCID-esque fallback behavior still basically happens for collation and encoding via the culture's CompareInfo and TextInfo objects. Which is not such a big deal, and it is really necessary since both of those objects need the context of a specific culture.
In retrospect, it might have been a better idea to not do things that way -- CompareInfo and TextInfo should not have been made available (as happens for other objects like the associated DateTimeFormatInfo and NumberFormatInfo), but it has shipped this way for two versions so we are kinda stuck with it.
One important difference that distinguishes them from neutral locales is that one could create a class that is derived from CultureInfo that contains language-specific information which would make more sense in neutral cultures, which is really a fancy way of saying "language-only cultures" (which is itself kind of a fancy way of say something).
There are also some odd situations with the LCID property of the CultureInfo, but thats a separate issue. More on this another day, too.
So, thats neutral cultures. Mostly not useful, except for resources -- except in the same way that they are useful in Win32 (by pretending its a specific culture). Or for potential extensibility either by Microsoft or by developers in the future.
Three steps forward, one step back? :-)
This post brought to you by "♎" (U+264e, a.k.a. LIBRA)
The quote in the title is an allusion to a quote from the Simpsons. Now the ANY key quote is not my favorite quote from Homer J. Simpson (actually, this is), but its in the top five.
And it popped into my head as I prepared to talk about the AltGR key, which is a key that does not exist on the keyboard upon which I am typing right now.
Anyway....
In a comment from a couple of days ago, Norman Diamond suggested that AltGr stood for Alternate Graphics. Thats fine as far as it goes, but only the first two words of his post suggest what AltGR stands for, and the words do not really explain what it means, though he talks a bit about what it does. So the question remains, where does ALTGR come from as a term?
Well, it does indeed stand for Alternate Graphics (or Alternative Grafiken). The original intended purpose of it was to have an easy way to get at the table-based graphical characters that were so handy to use in a console application, located on the right side of the spacebar.
It was, however, used quite actively for keyboards that needed extra keys (and there is no layout I know of today in Windows that supports the graphical characters except by accident in consoles, and they do not use ALTGR to get there). This does not apply to the US english keyboard hardware, so they just put a RIGHT ALT key there which will actually act as if it were the ALTGR key any time you switch to a layout that makes use of this extra shift state. Note that this extra shift state is also available by hitting <Ctrl>+<Alt>, but thats more work to type. So having a single key to type instead is much cooler.
Of course, this can cause problems since sometimes people make shortcuts using <Ctrl>+<Alt>, which screws with what people might want to actually do with a keyboard layout. In fact, Raymond Chen talked about Why Ctrl+Alt shouldn't be used as a shortcut modifier last March, explaining this fact.
I would extend Raymond's very good advice to anybody who uses MSKLC to create custom keyboards (note that MSKLC warns about assigning <Ctrl>+<Shift> to keyboards since many shortcuts are assigned there). Or people who uses Word to create shortcuts. Or people on the Microsoft Word team who created tons of "useful" shortcuts that do not mind stomping on what a keyboard layout may have assigned to a keystroke combination1. The key is to think about the keyboards and/or the shortcuts you create in the larger context of where you may either step on others or be stepped upon by them.
And if you create a custom keyboard with MSKLC, consider putting one of the graphical BOX DRAWING characters in the ALTGR state somewhere, so that you can be one of the cool people that makes the AltGR key meaningful again. Its like having an easter egg in software, but with an important recreational purpose!
1 - Every few months I start looking at the Word object model and its KeyBindings collection and related trivia to create a Word Add-in that will listen for keyboard changes and any time a WM_INPUTLANGCHANGE notification is received it would remove the Word shortcuts that conflicted with actual keyboard assignments. I find the undone project I was working on, get into it for a few hours, and then realize that this is something that the Word team or the Offce team ought to put together and build into the product. So I send off some mails and they agree with me and then it seems to go nowhere. A few months later it starts over again. Maybe one day one of us will have a finished solution for this problem. :-)
This post brought to you by "╦" (U+2566, a.k.a. BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL).The competition in the BOX DRAWING block of Unicode to do a topical sponsorship of the post was fierce; it was finally chosen by the drawing of lots, in order to avoid violence.In the future, an effort will be made to woo "appropriate sponsorship" from Unicode characters based on actual relevance to the specific post. Otherwise, its like a celebrity endorsement for a product that the famous person does not use -- and I hate that.
I have a box of candy in my office, and the two methods that seem most effective in keeping me between 161 and 165 pounds are to (a) try to fill the candy box with candy I do not like but other people do, and (b) not spend too much time at work and instead work from home. The second method is important since I also keep a large fridge filled with Limonata and if I am there too much I'll gain weight even without the candy and because other people like to fill the box, too. The first is important because I probably buy the most and I can dilute these other nice people.
Every once in a while I will see something new and I'll buy a bag of something that I have never seen before because I am curious what the hell it is. Most of them will be eaten before I get aroung to trying one and then I'll finally figure out if I liked it or not.
Have you ever had a particular kind of candy that you could not tell if you liked by trying it?
And have you ever found that trying it again later that day or the next day you still weren't sure?
Its probably just me.
Anyway, I haven't decided yet if I like blogs.
I mean, I have been doing this one for two months. I have been trying to post something relevant every day for at a little over a month of that. And at least four of those posts have been interesting. Its hard to sort out in the stats the people who link to you from the people who are just subscribing to hundreds of blogs and are thus not really reading any of this, but I think there are at least 20 people who read it now and again.
Yet, I can't tell if blogs annoy me yet.
I may not know until I can't think of something to post, and at that point I will be annoyed so it probably won't be fair to take that impression as an indication of how I feel about a whole technology.
Robert Scoble likes them a lot, but I have known him since he worked for Jim Fawcette and he always thinks some technology is the coolest thing in the world, and its always non-coinidentally what he is very involved with at the time. I'm not criticizing that, since if nothing else it proves he has convictions and believes in what he is doing/saying - which is a good thing. But its not a good way to get independent advice on what is cool. After all, he used to love the Offramp, too (and proably still does!), and I never really did, even when I used to post there....
Maybe the whole blog opinion thing will come to me one day when I don't suspect it.
Maybe blogs just taste like chicken. And I kind of like chicken. Though not every day....
On the other hand, maybe blogs taste like Limonata. In that case, you can expect about a case of posts every week!
This post brought to you by "✌" (U+270c, a.k.a. VICTORY HAND)