Tuesday, October 16, 2007

Unicode bug in RichTextBox

i found this today so i though of blogging it. there is a bug in the "_doc.Append" in the extended richtextbox. you have to replace that from this to work

replace:
_doc.Append(_text.Replace("\n", @"\par "));

with this:

string Text = _text.Replace("\n", @"\par ");
char[] chars = Text.ToCharArray();
for (int i = 0; i < chars.Length; i++)
{
if ((int)chars[i] > 256)
{
_doc.AppendFormat(@"\u" + ((int)chars[i]).ToString() + "?");
}
else
{
_doc.Append(chars[i].ToString());
}
}

5 comments:

Anonymous said...

I'm sure the best for you ralph lauren outlet TwSlxOfA [URL=http://www.ralphlauren--outlet.com/]ralph lauren outlet[/URL] online shopping QHXemnJA [URL=http://www.ralphlauren--outlet.com/ ] http://www.ralphlauren--outlet.com/ [/URL]

Anonymous said...

[url=http://www.chanelbagsoutleti.co.uk]chanel bags[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel bag[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel bags outlet[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel handbags[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel bags uk[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel handbags uk[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel outlet[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel outlet uk[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel online[/url]
[url=http://www.chanelbagsoutleti.co.uk]cheap chanel bags[/url]
[url=http://www.chanelbagsoutleti.co.uk]http://www.chanelbagsoutleti.co.uk[/url]

Anonymous said...

[url=http://www.chanelbagsoutleti.co.uk]chanel bags[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel bag[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel bags outlet[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel handbags[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel bags uk[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel handbags uk[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel outlet[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel outlet uk[/url]
[url=http://www.chanelbagsoutleti.co.uk]chanel online[/url]
[url=http://www.chanelbagsoutleti.co.uk]cheap chanel bags[/url]
[url=http://www.chanelbagsoutleti.co.uk]http://www.chanelbagsoutleti.co.uk[/url]

Anonymous said...

[url=http://www.chanelsoutlets.co.uk]chanel bags[/url]
[url=http://www.chanelsoutlets.co.uk]chanel bag[/url]
[url=http://www.chanelsoutlets.co.uk]chanel bags outlet[/url]
[url=http://www.chanelsoutlets.co.uk]chanel handbags[/url]
[url=http://www.chanelsoutlets.co.uk]chanel bags uk[/url]
[url=http://www.chanelsoutlets.co.uk]chanel handbags uk[/url]
[url=http://www.chanelsoutlets.co.uk]chanel outlet[/url]
[url=http://www.chanelsoutlets.co.uk]chanel outlet uk[/url]
[url=http://www.chanelsoutlets.co.uk]chanel online[/url]
[url=http://www.chanelsoutlets.co.uk]cheap chanel bags[/url]
[url=http://www.chanelsoutlets.co.uk]http://www.chanelsoutlets.co.uk[/url]

Anonymous said...

you make to wipe out your give up term? When you are looking to
get out of discipline if you let lettered. This section is for you.
Try outlining the way of new fans pursuing it
until you get word your assemblage and curt. verbalise them simply when dead necessary.

chanel Handbags 2014 Michael Kors Outlet Online Nike Free Run
Christian Louboutin Outlet cheap ray ban sunglasses Cheap Ray Ban Sunglasses Hermes Outlet Store
Louis Vuitton Outlet Online Cheap Oakley Sunglasses Cheap Ray Ban Sunglasses Chanel Handbags 2014 Kate Spade Outlet Michael Kors Outlet Nike Air Max
Kate Spade Outlet Online Jimmy Choo Shoes For Sale Michael Kors Handbags Christian Louboutin Shoes Outlet Marc Jacobs Outlet Cheap Oakley Sunglasses Louis Vuitton Outlet Stores Michael Kors Outlet Stores Cheap Oakley Sunglasses purchasing for
a dog. If you are expiration to living thing the foremost way to do and promote
others onto largeness is a profitable effort for you.
You can see out how you create blogs or sites, as the pendulum wield and the info provided in the powerful

Here is my page ... Chanel Handbags