Dmitry Timoshkov wrote:
"Shachar Shemesh" wine-devel@shemesh.biz wrote:
The main reason is that they are loaded based on encoding, rather than language. This has several implications that caused me not to go that route:
- The mapping between encoding and charcter encoding is not a
straightforward one. The reverse mapping is even less so.
Well, GetTextCharset() does exactly what you want.
I seem to have been totally misunderstood, possibly because of the wrong use of "locale" instead of "charset" in my previous mail.
The situation is this: We have a font. This font supports several charsets. (Almost) each charset is used by several locales, but that is besides the point. We need to know which characters to use as a sample text demonstrating each charset. We need some kind of a table. This table does not depend on the current locale.
You suggest resource. I say that this seems like the wrong tool for the job, as the resource information seems based on locale, and the locale does not play a role here. Maybe I misunderstood what you meant.
Please explain: 1. What kind of a resource should I use, in your opinion? 2. How should I select which resource to load, given a specific locale? 3. What is the advantage of this mechanism?
These two mean that placing the sample text in a resource will only server to confuse the issue. The first point is even harder - what if you want different sample text for Chinese BIG-5 and the other Chinese encoding? Which language should I try to load for centeral Europe? French? German? I can only load one.
Exactly. GetTextCharset() is your friend here. Just have different strings for different charsets in the resources and load them at appropriate time.
You lost me there. How does GetTextCharset help me, in any way? I'll just remind you that thing I have given is the charset, and what I'm searching for is the text.
In short, doing that through resources seems like an unnecessary complication to me. Add to that the fact that you still need the mapping table, and you get "ain't worth the hassle".
I hope you will reconsider.
I'll be happy to. Just let's try and understand the implications.
Shachar