Solved

chracter set question easy but urgent

Posted on 2007-03-30
5
388 Views
Last Modified: 2008-02-01
The following code works fine. Easy question to someone with experience: what is the ü ? I don't understand how to work these character maps. The  ü is actually a checkmark when you run the program. How do I program other characters in that set?

Code:

WxPanel1->Connect( ID_WXPANEL1, wxEVT_PAINT, wxCommandEventHandler(MVMFrm::PanelPainterX) );

void MVMFrm::PanelPainterX(wxCommandEvent& event)
{
        // Function to paint a wxWindow
    wxPaintDC TempDC(this);
    TempDC.SetFont(wxFont(18,wxFONTFAMILY_DECORATIVE,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,wxT("Wingdings")));
    TempDC.SetTextForeground(wxColour(0, 200, 0));
    TempDC.DrawText(wxT("ü"),100,150);

    event.Skip();
}

Thanks
0
Comment
Question by:Wanderinglazyeye
5 Comments
 
LVL 29

Assisted Solution

by:pepr
pepr earned 50 total points
ID: 18827752
I guess you could do one of the two things wrongly.

Firstly, your source code was prepared by the editor that is not Unicode enabled and you actually do not have checkmark in your source, but the u with umlaut.

Secondly, you have compiled the source as "normal" application and not as Unicode application.

Also, your compiler have to know what encoding is used for creating the sources. Otherwise, it is not able to interpret your literal wxT("ü") correctly (if Unicode is enabled, it becomes L"ü" -- stlill compiler has to know what character was written down). If the compiler is capable to process the source file, then probably the best way is to store the source code in UFT-8 format with BOM (i.e. the Byte Order Mark -- the special sequence that can be stored at the beginning of a UTF-8 files).

Try some hexview tool or some Unicode capable external editor (like jEdit, www.jedit.org) to look what is really stored in the source.
0
 

Author Comment

by:Wanderinglazyeye
ID: 18827796
Hmmm. My question is really basic. Is the U with the umlaut part of a character map that corresponds to a graphic? When my widgets app compiles, I se a checkmark, which is fine. But I want to use a different symbol in the same table. Where do I look these up? I don't get it - is the U with the umlaut the code for a check mark in that particular map?
0
 
LVL 22

Accepted Solution

by:
danaseaman earned 225 total points
ID: 18827926
This is not a Unicode issue. All you need to do is run program Charmap.exe and select Font Wingdings. There you will see all 256 available symbols. Moving mouse over desired symbol will give the Hex code (example 0xFC for Checkmark). Click on the desired symbol, click Select button and it will appear as checkbox in the Textbox window. Then click Copy and it will be placed on the clipboard. Finally paste this character into your source code and it will appear as umlaute (ü).

 
0
 
LVL 6

Assisted Solution

by:bijopuli
bijopuli earned 225 total points
ID: 18827972
Hi

yes danaseaman is right...
your function in the code snippet is setting the font to "Windings"
and drawing the Check Symbol Mark. Actually Windings is a char set which contains all those little graphical symbols instead of letters. and the character code for this check mark is 0xFC. u can observe this in the "Charmap.exe" utility which comes along with windows.

U r seeing the "ü" in your code instead of checkmark because ur Code editor uses some other font (Most probably "Courier")

Are u using VC6 IDE?
if so u can test this simply by selecting that purticular character "ü"

and do the following

Goto Tools > Options, now select Format Tab, select "Source Window" in Catogory, Now there will be a Font: Combo drop down, if u select the Font "Windings" From there and press ok u will see the special character ü as a Check Mark

Is it clear now?

Regards
Bijo.
0
 

Author Comment

by:Wanderinglazyeye
ID: 18828626
I get it. All good. Works fine. What threw me was why in copying one character you get another. Seems anitquated, backwards. But I've got it going now.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question