qdoom

Hi,

In Unicode you can somehow combine two or more characters into one. You do that by adding some number of combining characters to a base character. How can that be done in C#

An example would be great.

Thanks.




Re: Visual C# Express Edition Unicode

johan idstam

A character in unicode can be made of one or more bytes. The first 127 characters are the same as the ones in ASCII.

Unicode is huge issue. Read more about it here: http://en.wikipedia.org/wiki/Unicode

It's probably not the answer you are looking for though.

What are you trying to do


/johan/




Re: Visual C# Express Edition Unicode

qdoom

There's a way with the help of Unicode to "create" characters.

http://unicode.org/faq/char_combmark.html

If you have the time, you can actually read what's written there. I'll just quote one part, and I hope you'll see what I mean:

Q. Unicode doesn't contain some of the precomposed characters needed for Navajo and other indigenous languages of the Americas. Will you add them

A. The way to encode the various Navajo letters with diacritics is with the use of combining marks. For example, Navajo high-toned nasalized vowels:

a + ogonek + acute = <U+0061, U+0328, U+0301>

and so on for the other vowels.

Still, I have no clue how to do that in VC#. How do you use combined character sequences in such properties as .text






Re: Visual C# Express Edition Unicode

jrboddie

Try this:

string ax = new string(new char[]{'\u0061', '\u0328', '\u0301'});

textBox1.Text = ax;





Re: Visual C# Express Edition Unicode

qdoom

That was the solution! I only needed to add one more line (textbox was showing it as one character, but treating it as two (for example: 2xbackspaces to delete it))

For some reason, it didn't make all three characters into one, only two, but I'll figure it out from here (and I actually don't need to combine more than two anyway (and at least now, I don't think, that I'll need to). Thanks a lot.

Code Snippet

string ax = new string(new char[] { '\u0061', '\u0328' });

ax = ax.Normalize(); //NormalizationForm.FormC FormKC also works.

textBox1.Text = ax;