You've got to ACCentuate the positive (or perhaps it would be better not to be so quick to do so!)

by Michael S. Kaplan, published on 2012/06/28 07:01 -04:00, original URI:

There are times when I can blog rather indirectly, obliquely, and/or theoretically.

Even though some real problem may have originally inspired it -- perhaps an issue that is being discussed with a not-yet-shipped product.

This is kind of cool since people involved with the problem will see the blog inspired by it, and it can help them frame their arguments.

For example, Four cases where I don't like ResolveLocaleName (and you shouldn't either!) was brought up in a meeting where people discussed how to possibly fix that problem.

These "collaborations" are often "conspiracies" in the legal sense, where you have multiple people working on issues without always being aware of each other or their efforts (kind of a Law & Order reference to the 1991 episode The Torrents of Greed -- the right hand doesn't have to know what left hand is doing for then to be part of a conspiracy, whether to commit a crime or to solve an technical problem!

Another example would be When you have just one model, the easiest place to fall short is when something's missing..., where I talked about the complications involved with determining whether a positive number might be 3 versus +3 or even 3+, due to problems in the model that we've never managed to fully sort out.

Then the other day, the following anonymous blog was received by me, from someone who has seen some more direct consequences to the problem, in both shipping product and not yet shipped product:

LOCALE_IPOSSIGNPOSN and LOCALE_SPOSITIVESIGN allow a locale to specify how positive numbers are decorated. They can specify a string and a position. But nobody actually uses it. And sometimes people who try discover that it looks awful because some locale data (such as es-US and el) say “I want a plus sign in front of all positive numbers”, but when you actually put a plus sign in front, people complain “Hey, why are all these plus signs in front of all my positive numbers?”

“Right here, you said that you wanted plus signs in front of all your positive numbers.”

“Yeah, sure, but I didn’t expect you listen to me!”

It’s made more confusing because LOCALE_INEGSIGNPOSN says “Formatting index for the negative sign in currency values”
But LOCALE_IPOSSIGNPOSN says “Formatting index for positive values.” (Note: Not restricted to currency.)

// Although LOCALE_IPOSSIGNPOSN or LOCALE_SPOSITIVESIGN are documented to produce the proper positive format and
// some locales (es-US, el) specify that they want a + (LOCALE_SPOSITIVESIGN) in front of all positive numbers (LOCALE_IPOSSIGNPOSN),
// this request is ignored by .NET and most Win32 apps. So we ignore it too.

Just about now, there are unrelated conversations about whether/how to get code that took the data at its word when maybe it shouldn't have trusted the data quite so much.

Kind of interesting how the conspiracy unfolds! :-)

Random832 on 29 Jun 2012 6:08 AM:

Well, maybe there needs to be a new locale value to indicate that they really mean it.


Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day