stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: do we still need rwstderr.rc?
Date Wed, 19 Sep 2007 19:55:11 GMT
Travis Vitek wrote:
>  
> 
> Farid Zaripov wrote:
>> Subject: Re: do we still need rwstderr.rc?
>>
>> I agree that if gencat would accept .msg files instead of .rc files it
>> would be great improvement. But then we need to decide how to deal
>> with possible multiple sets in .msg file. The .rc file doesn't have
>> the sets. We can encode set number and message number to ID in .rc
>> file (0 <= ID <= 0xffff):
>>
>> ID = set * 0x100 + msg        - 256 sets by 256 messages per set, or
>> ID = set * 0x1000 + msg      - 16 sets by 4096 messages per set
>>
> 
> This is a little off topic, but since it was just brought it up I figure
> I should mention it. IMO, there is actually a pretty annoying
> compatibility problem with this behavior. On windows, you cannot use
> std::messages<>::get() as you would on non-windows platforms because the
> set number is ignored on windows.
> 
> You can see evidence of this issue in the tests [22.locale.messages.cpp
> and 22.locale.messages.mt.cpp]. Those tests create a message catalog
> with 5 sets of 5 messages. On a non-windows system, msgs.get (cat, 5, 5,
> "") returns the fifth message in the fifth set, but on windows systems
> it returns the fifth message in the _first_ set. The tests skirt around
> this issue with a function named msg_id(). It takes a set number and a
> message number and returns the actual message number using the scheme
> mentioned above.
> 
> If there is only one message set in the catalog, there is no problem.
> The other frustrating thing is that I wasn't able to find anything in
> the documentation that mentioned this limitation, or the workaround. The
> example sidesteps the issue in another way, by giving each message a
> unique id.
> 
> Is this wrong, or am I just misinformed or confused?

I know little about how the messages facet behaves on Windows
but simply ignoring the set number definitely seems wrong. It
doesn't look like the standard actually requires us to use it
but ignoring it makes the implementation of the facet pretty
poor quality.

Martin


Mime
View raw message