|
-
November 6th, 2006, 11:05 AM
#1
How do I switch code pages?
I have an application using narrow-character MFC where resource strings used for program output can be switched between multiple languages. I have been asked to support Russian, which requires a different code page. How can I convince the application that it is running in the code page that the user has selected?
-
November 6th, 2006, 11:44 AM
#2
Re: How do I switch code pages?
The main problems:
- this code page must be available
- the fonts used by all the controls/menus/... in your app must support cyrillic (such fonts as Arial unicode, Tahoma, Microsoft Sans Serif, ...)
-
November 6th, 2006, 12:07 PM
#3
Re: How do I switch code pages?
 Originally Posted by VictorN
The main problems:
- this code page must be available
- the fonts used by all the controls/menus/... in your app must support cyrillic (such fonts as Arial unicode, Tahoma, Microsoft Sans Serif, ...)
We don’t support Windows before Windows 2000 and could live with reqiring Russian users to use XP. Unfortunately we want to implement Russian quickly so we don’t want to switch to wide characters.
We use normal fonts, nothing unusual.
-
November 6th, 2006, 12:16 PM
#4
Re: How do I switch code pages?
 Originally Posted by Andrew Hain
We don’t support Windows before Windows 2000 and could live with reqiring Russian users to use XP. Unfortunately we want to implement Russian quickly so we don’t want to switch to wide characters.
We use normal fonts, nothing unusual.
You don't need using "wide characters". You don't need requiring Russian users to use XP (Win 2000 would ba also OK).
What you need is to be sure the russian locale is installed and the fonts your App is using support russian (note, not all the fonts on the non-russian Windows can support russian!).
Then your App should load the resource DLL (I hope, all language dependable resources of your App are in the DLLs) with russian resources and run!
-
November 6th, 2006, 12:16 PM
#5
Re: How do I switch code pages?
Unfortunately there is no quick way to do this. Even if the display were working properly, you would still have problems with strings that get passed around from the UI to the Windows API and many more things. Microsoft does provide an application container that simulates running an application on a system with a different codepage, but that's not something you can use to distribute an application.
The "quick and dirty" way you want is to just store the resources in cyrillic and then before anything is drawn on the windows, always select a font with a cyrillic character set.
However, I would strongly suggest to seriously consider switching to a Unicode build. If you are working mostly with resources for display strings and don't pass strings around too much inside the UI <> Business layer connection, it's probably as quick to implement as the other solution and you'll have solved the problem for *any* character set, not just cyrillic.
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
-
November 7th, 2006, 04:55 AM
#6
Re: How do I switch code pages?
 Originally Posted by Yves M
However, I would strongly suggest to seriously consider switching to a Unicode build. If you are working mostly with resources for display strings and don't pass strings around too much inside the UI <> Business layer connection, it's probably as quick to implement as the other solution and you'll have solved the problem for *any* character set, not just cyrillic.
Unfortunately, we are currently in beta and are trying to drop in Russian support as unintrusively as possible. We were already intending to use Unicode builds for future releases.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|