D
DAXU
Hi,
Can anyone tell me how to put char like ½ to a string? Do I need to
use \u...?
Many Thanks
Can anyone tell me how to put char like ½ to a string? Do I need to
use \u...?
Many Thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
DAXU said:Can anyone tell me how to put char like ½ to a string? Do I need to
use \u...?
Rene said:Are you adding this character to your source coed? If so, what's wrong with
just coping and pasting the character to your source file? Visual Studio
should be able to handle it no problem.
Your Usenet client illustrates the problem nicely, I'd say, seeing as how itJon said:In my experience it's a bad idea to have non-ASCII characters in source
code. If every tool you use understand the encoding involved, it's fine
- but often that's not the case.

Jeroen Mostert said:Your Usenet client illustrates the problem nicely, I'd say, seeing as howit
doesn't handle Q-encoded headers properly.![]()

Then again, conservatism is what causes these encoding problems to persist
in the first place. Programmers should demand and get tools that, at least,
handle UTF-8 correctly. And let's face it: most C# programmers will never
see any tool but Visual Studio, and the tools it runs in the background are,
as far as I've ever seen, all good Unicode citizens.
Of course, these issues are made moot if you walk the high road and put your
strings in a resource assembly. Somehow, I don't think "½" is often part of
a non-localized string.
Jon said:My Usenet client is fine - it handled DAXU's original post just fine,
preserving the Q-encoded header.
Hey, I like WinDiff, the venerable old workhorse (and its lack of UnicodeDoes WinDiff do the right thing? Other source control clients?
Jeroen Mostert said:My Usenet client is fine - it handled DAXU's original post just fine,
preserving the Q-encoded header.
This is the original post:
From: DAXU <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.csharp
Subject: =?ISO-8859-1?Q?how_to_put_character_like_=BD_to_a_string=3F?=
Date: Thu, 14 Feb 2008 07:51:56 -0800 (PST)
Organization: http://groups.google.com
Lines: 6
Message-ID: <4ac4fed9-b0dc-4376-bc27-9c843458b069@c23g2000hsa.googlegroups.com>
Here's your first reply to that post (not Rene's):
From: Jon Skeet [C# MVP] <[email protected]>
Subject: Re: =?ISO-8859-1?Q?how_to_put_character_like_=3DBD_to_a_strin?=
=?ISO-8859-1?Q?g=3F?=
Date: Thu, 14 Feb 2008 16:00:36 -0000
Message-ID: <[email protected]>
That doesn't look right to me.
Hey, I like WinDiff, the venerable old workhorse (and its lack of Unicode
support falls on the "old" side rather than the "venerable"), but if you're
using it as a *source control client* something's seriously wrong with your
setup.
Even SourceSafe can handle Unicode (OK, so you need at least VSS 2005, but
I'm assuming you've got that if you're developing .NET), and SourceSafe
isn't exactly known as the most professional solution.

If your source control doesn't handle Unicode, then by all means send it
back for a refund. I would not accept that as an argument to forego Unicode.
You couldn't even version most XML files with such a system.
DAXU said:Can anyone tell me how to put char like ½ to a string? Do I need to
use \u...?
Jon Skeet [C# MVP] wrote:> Rene said:Are you adding this character to your source coed? If so, what's wrong with
just coping and pasting the character to your source file? Visual Studio
should be able to handle it no problem.In my experience it's a bad idea to have non-ASCII characters in source
code. If every tool you use understand the encoding involved, it's fine
- but often that's not the case.
Your Usenet client illustrates the problem nicely, I'd say, seeing as how it
doesn't handle Q-encoded headers properly.
Then again, conservatism is what causes these encoding problems to persist
in the first place. Programmers should demand and get tools that, at least,
handle UTF-8 correctly. And let's face it: most C# programmers will never
see any tool but Visual Studio, and the tools it runs in the background are,
as far as I've ever seen, all good Unicode citizens.
Of course, these issues are made moot if you walk the high road and put your
strings in a resource assembly. Somehow, I don't think "½" is often partof
a non-localized string.
I like it to, but I have moved to KDiff3 for a while now, and I am ok withHey, I like WinDiff, the venerable old workhorse (and its lack of Unicode
support falls on the "old" side rather than the "venerable"), but if you're
using it as a *source control client* something's seriously wrong with your
setup.
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.