Displaying characters on a windows form from another codepage

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • adiel_g@hotmail.com

    #1

    Displaying characters on a windows form from another codepage

    I am trying to display some data that I received into a form. The
    form is in english. The data is in cyrillic (russian) which uses
    codepage 1251. I am trying to change the button text to russian. For
    example:

    cmdCancel.Text = "Îòìåíèòü"

    Those are garbage characters which I dont mind if they are in that
    format in the code. But when the actual button is displayed on the
    screen, I want the real cyrillic (russian) characters to be
    displayed. This will be used to translate all the buttons on the page
    to cyrillic (russian). My question is how do I change the form to
    show characters in cyrillic (russian) without changing the codepage
    for the entire computer?

    To get an idea of what I am looking for, I would like to run some type
    of command such as:

    me.codepage = 1251 ' This command does not exit, just a sample of
    what I am looking for.

    to display the cyrillic (russian) characters for the entire form...

    Thanks Before Hand,
    Adiel
  • Armin Zingler

    #2
    Re: Displaying characters on a windows form from another codepage

    <adiel_g@hotmai l.comschrieb
    I am trying to display some data that I received into a form. The
    form is in english. The data is in cyrillic (russian) which uses
    codepage 1251. I am trying to change the button text to russian.
    For example:
    >
    cmdCancel.Text = "Îòìåíèò ü"
    If I enter cyrillic characters in source code, they display fine on the
    button. (using default font "Microsoft Sans Serif").

    cmdCancel.Text = "ФЙ"

    Where do you store the texts? Where do you read them from?

    (Note that this posting is UTF-8 encoded)


    Armin


    Comment

    • Cor Ligthert[MVP]

      #3
      Re: Displaying characters on a windows form from another codepage

      >My question is how do I change the form to
      >show characters in cyrillic (russian) without changing the codepage
      >for the entire computer?
      In my idea you cannot. The characters are displayed by the OS, as that does
      not has the codepages installed for that, what should it do then? (Be aware
      that this is not so clear in Vista as it was in past).

      Cor

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Displaying characters on a windows form from another codepage

        <adiel_g@hotmai l.comschrieb:
        >I am trying to display some data that I received into a form. The
        >form is in english. The data is in cyrillic (russian) which uses
        >codepage 1251. I am trying to change the button text to russian. For
        >example:
        >
        >cmdCancel.Te xt = "Îòìåíèòü"
        Please do not multipost. I replied in the Windows Forms group.

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

        Comment

        • adiel_g@hotmail.com

          #5
          Re: Displaying characters on a windows form from another codepage

          I found out what the problem is. The file they sent me with the
          russian characters to use was in "russian ANSI" (not sure if this is
          what it is called). So when I opened the file and pasted the
          characters in the button I got this:

          cmdCancel.Text = "Îòìåíèò ü"

          Since the originating user that created the file has a different code
          page in windows, the characters could not be read properly on my
          system. I will have him sent me a file that is unicode format. That
          file I should be able to read. Then I can place the characters
          directly in the code as explained above:

          cmdCancel.Text = "ФЙ" ' <- characters are already in the correct
          format, they will display correctly.


          I have learn this also:

          1. If you are saving characters from another code page in your form
          using vs2005, visual studio will automatically show a prompt asking if
          you want to change the format of the source code file from ANSI to
          UNICODE. (Of course you would answer yes to keep the russian
          characters in the correct format in your source code)

          Thanks Everyone,

          Adiel

          Comment

          Working...