Problem displaying Unicode characters on my forms labels and butto

G

Guest

I am having a problem displaying Unicode characters on my Forms labels and
buttons. After coding Button1.Text = unicode; where the unicode is a Unicode
character or string (‘\u1234’ or “\u1234â€) It seems to work the first time I
set the button to the Unicode character. After a while, when saving my code,
I get a pop-up window stating that I need to save the file as a Unicode else
my changes will not be saved.

Seance I do not want to save my file as Unicode, because it does not make
any séance for me to save my code file as a Unicode extension. I don’t even
have that extension available and even if I do I don’t think my code will
compile any more.
So when I close visual studio and reopen it, my changes (the line of code:
Button1.Text = Unicode) has been deleted. But if I have Button.Text =
Sometimes it will be replaced by a ? inside the double quote and when running
the program it will display ?.

What change do I need to make so that Button.Text is set to the Unicode
character and will not be deleted if I reload visual studio?

Kidus.
 
C

Carlos J. Quintero [.NET MVP]

In my test VS.NET has not said anything about saving as Unicode and it works
fine, but if VS.NET warns you about saving as unicode, you should do it, at
least for a test. Also, take a look at the File\Advanced Save Options dialog
to select manually the codepage.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
J

Jon Skeet [C# MVP]

Kidus Yared said:
I am having a problem displaying Unicode characters on my Forms labels and
buttons. After coding Button1.Text = unicode; where the unicode is a Unicode
character or string (?\u1234? or ?\u1234?) It seems to work the first time I
set the button to the Unicode character. After a while, when saving my code,
I get a pop-up window stating that I need to save the file as a Unicode else
my changes will not be saved.

Seance I do not want to save my file as Unicode, because it does not make
any s?ance for me to save my code file as a Unicode extension. I don?t even
have that extension available and even if I do I don?t think my code will
compile any more.

I don't know what you mean by "a Unicode extension" - your file will
have the same extension as before, but be stored in Unicode.
So when I close visual studio and reopen it, my changes (the line of code:
Button1.Text = Unicode) has been deleted. But if I have Button.Text =
Sometimes it will be replaced by a ? inside the double quote and when running
the program it will display ?.

What change do I need to make so that Button.Text is set to the Unicode
character and will not be deleted if I reload visual studio?

Just save the file as Unicode.
 
M

Mihai N.

I am having a problem displaying Unicode characters on my Forms labels and
buttons. After coding Button1.Text = unicode; where the unicode is a ....
What change do I need to make so that Button.Text is set to the Unicode
character and will not be deleted if I reload visual studio?

You mean you do that in the code? Sorry, this is just not the right way.
You should have no linguistic data in the code.
Store the string you want in a resource file (which is utf-8), and at runtime
load it and set the text of the button.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top