Display text in different languages using unicode

namespace Unicodeinfo
  {
      public partial class Unicodefrm : Form
      {
         public Unicodefrm()
         {
            InitializeComponent();
         }
 
        // assign Unicode strings to each Label
        private void Unicodefrm_Load( object sender, EventArgs e )
        {
           // English
           char[] english = { '\u0057', '\u0065', '\u006C',
              '\u0063', '\u006F', '\u006D', '\u0065', '\u0020',
              '\u0074', '\u006F', '\u0020' };
           englishLabel.Text = new string( english ) +
              "Unicode" + '\u0021';
 
               // French
              char[] french = { '\u0042', '\u0069', '\u0065',
                 '\u006E', '\u0076', '\u0065', '\u006E', '\u0075',
                 '\u0065', '\u0020', '\u0061', '\u0075', '\u0020' };
              frenchLabel.Text = new string ( french ) +
                 "Unicode" + '\u0021' ;
 
              // German
              char[] german = { '\u0057', '\u0069', '\u006C',
                 '\u006B', '\u006F', '\u006D', '\u006D', '\u0065',
                 '\u006E', '\u0020', '\u007A', '\u0075', '\u0020' };
              germanLabel.Text = new string ( german ) +
                 "Unicode" + '\u0021';
 
              // Japanese
              char[] japanese = { '\u3078',  '\u3087', '\u3045',
                 '\u3053', '\u305D', '\u0021'};
              japaneseLabel.Text = "Unicode" + new string( japanese );
 
              // Portuguese
              char[] portuguese = { '\u0053', '\u0065', '\u006A',
                 '\u0061', '\u0020', '\u0062', '\u0065', '\u006D',
                 '\u0020', '\u0076', '\u0069', '\u006E', '\u0064',
                 '\u006F', '\u0020', '\u0061', '\u0020' };
              portugueseLabel.Text = new string ( portuguese ) +
                 "Unicode" + '\u0021';
 
               // Russian
              char[] russian = { '\u0414', '\u043E', '\u0431',
                 '\u0440', '\u043E', '\u0020', '\u043F', '\u043E',
                 '\u0436', '\u0430', '\u043B', '\u043E', '\u0432',
                 '\u0430', '\u0442', '\u044A', '\u0020', '\u0432', '\u0020' };
              russianLabel.Text = new string ( russian ) +
                 "Unicode" + '\u0021';
 
               // Spanish
              char[] spanish = { '\u0042', '\u0069', '\u0065',
                 '\u006E', '\u0076', '\u0065', '\u006E', '\u0069',
                 '\u0064', '\u006F', '\u0020', '\u0061', '\u0020'};
              spanishLabel.Text = new string ( spanish ) +
                  "Unicode" + '\u0021';
 
               // Simplified Chinese
              char[] chinese = { '\u6B22', '\u8FCE', '\u4F7F',
                 '\u7528', '\u0020'};
              chineseLabel.Text = new string ( chinese ) +
                 "Unicode" + '\u0021';
           } // end method Unicodefrm_Load
        } // end class Unicodefrm
    } // end namespace Unicodeinfo

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.