Solved

chracter set question easy but urgent

Posted on 2007-03-30
5
364 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 28

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now