by Michael S. Kaplan, published on 2005/10/29 03:01 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2005/10/29/486617.aspx
Yoshihiro kawabata asked the suggestion box:
Hello, Michael.
About U+221E.
I test this code in SQL Server 2005.
select convert(varchar, nchar(0x221E))
Result:
'8' Collation(Latin1_General_CI_AS).
'∞' Collation(Japanese_CI_AS).
Why U+221E is convert to 8 in Latin1_General_CI_AS ?
The answer can be found in prior posts such as If the shoe [best-]fits.... and BestBetter than nothing fit mappings, unleashed, #1. In fact, if you look at that second post you will see that I marked this particular mapping as my favorite one.
What is clear is that SQL Server is simply calling WideCharToMultiByte without passing the WC_NO_BEST_FIT_CHARS flag. So any of the best fit mappings that exist in the code page are picked up.
At least now you know why a full eight-hour day at work can seem to take forever. Because depending on the code page you use, they can kind of be the same thing....
This post brought to you by "8" and "∞" (U+0038 and U+221e, a.k.a. DIGIT EIGHT and INFINITY)
Two characters who are great friends, merely a single best fit mapping away from each other!
# Heath Stewart on 29 Oct 2005 8:26 AM:
# Michael S. Kaplan on 29 Oct 2005 1:42 PM:
# Yoshihiro kawabata on 31 Oct 2005 12:01 AM:
# Michael S. Kaplan on 31 Oct 2005 7:29 AM:
referenced by