Unicode String in TreeView

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • miztaken

    Unicode String in TreeView

    Hi,
    I have a string with some unicode characters and when i tried to
    displayed it in TreeView its not displaying.

    I am doing like this:
    TreeNode tn = new TreeNode("unico destring");
    treeView.Nodes. Add(tn);

    i can see the unicode characters in DEBUG mode in Visualizers (XLM,
    HTML and TXT) but i cant see it on TreeView, it gets displayed as
    squares.


    What am i doing wrong here?

    help me
    miztaken
  • Cor Ligthert [MVP]

    #2
    Re: Unicode String in TreeView

    miztaken,

    Do you see them on your own developing computer wrong or in a seperated
    computer?

    Cor

    "miztaken" <justjunktome@g mail.comschreef in bericht
    news:2b0d0dc8-25b0-41a8-8c05-a1bd0edf2cb4@y2 1g2000hsf.googl egroups.com...
    Hi,
    I have a string with some unicode characters and when i tried to
    displayed it in TreeView its not displaying.
    >
    I am doing like this:
    TreeNode tn = new TreeNode("unico destring");
    treeView.Nodes. Add(tn);
    >
    i can see the unicode characters in DEBUG mode in Visualizers (XLM,
    HTML and TXT) but i cant see it on TreeView, it gets displayed as
    squares.
    >
    >
    What am i doing wrong here?
    >
    help me
    miztaken

    Comment

    • Peter Duniho

      #3
      Re: Unicode String in TreeView

      On Thu, 25 Sep 2008 03:52:54 -0700, miztaken <justjunktome@g mail.com>
      wrote:
      Hi,
      I have a string with some unicode characters and when i tried to
      displayed it in TreeView its not displaying.
      FYI: in this context, the phrase "a string with some unicode characters"
      is redundant, if not nonsensical. In C#, all strings are Unicode
      strings. All characters in a string are Unicode characters. It happens
      that some Unicode characters share the same numerical value as some
      non-Unicode characters, but that doesn't keep them from being Unicode
      characters.
      I am doing like this:
      TreeNode tn = new TreeNode("unico destring");
      treeView.Nodes. Add(tn);
      >
      i can see the unicode characters in DEBUG mode in Visualizers (XLM,
      HTML and TXT) but i cant see it on TreeView, it gets displayed as
      squares.
      >
      >
      What am i doing wrong here?
      You're using a font for the TreeView that doesn't include glyphs for the
      characters you're trying to display. You should use a different font, one
      that does have glyphs for those characters.

      Pete

      Comment

      • miztaken

        #4
        Re: Unicode String in TreeView

        I am working on a single PC.

        Comment

        • miztaken

          #5
          Re: Unicode String in TreeView

          Hi Pete,
          Thanks for the reply.
          I am using default Arial font for TreeView.
          I have tried using Tahoma and Times New Roman and still the same case.
          Which font do you suggest ?

          And wont we have some condition where the used font might fail for the
          text to be displayed? How can we handle such case?

          thank you

          Comment

          • miztaken

            #6
            Re: Unicode String in TreeView

            hey there,
            i used Arial Unicode MS font and it worked.
            Thank You

            Comment

            • Peter Duniho

              #7
              Re: Unicode String in TreeView

              On Thu, 25 Sep 2008 04:19:47 -0700, miztaken <justjunktome@g mail.com>
              wrote:
              [...]
              And wont we have some condition where the used font might fail for the
              text to be displayed? How can we handle such case?
              Yes, it's always possible that the font you want to use won't show the
              characters you want to use. I'm not aware of any font that has _every_
              possible Unicode character, and even if such a font exists, it's not
              necessarily one that has a suitable look for your needs.

              That said, fonts generally support specific ranges of characters, so
              assuming the characters you're using have something in common with each
              other with respect to their placement within the Unicode space, a font
              that supports any of the characters you're specifically trying to use will
              probably support all of the characters you're trying to use.

              The only way to know for sure though is to test it, or at least check all
              of the characters supported by the font.

              I see from your follow-up that you found a font that works, so hopefully
              that means that font will support all of the characters you're trying to
              use. Without knowing exactly the characters, I can't say for sure that it
              will. But you've got good odds that it will. :)

              Pete

              Comment

              • miztaken

                #8
                Re: Unicode String in TreeView

                Yea, you are true.
                Thank you very much for sharing your thoughts.

                miztaken

                Comment

                • Mihai N.

                  #9
                  Re: Unicode String in TreeView

                  And wont we have some condition where the used font might fail for the
                  text to be displayed? How can we handle such case?
                  Windows in general does a good job to find a font that works.
                  (things like font fallback, font linking, font substitution)

                  Are you on XP? And if yes, do you have the proper support installed?

                  Try "Control Panel" - "Regional and Language Options" -- second
                  tab, "Languages" , make sure to check the two checkboxes under
                  the "Supplement al language support" group



                  --
                  Mihai Nita [Microsoft MVP, Visual C++]
                  Best internationalization practices, solving internationalization problems.

                  ------------------------------------------
                  Replace _year_ with _ to get the real email

                  Comment

                  Working...