<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-32442424.post4581709963362320971..comments</id><updated>2010-03-03T19:59:22.510Z</updated><category term='TIFF'/><category term='Vista'/><category term='widgetbox'/><category term='Image'/><category term='Visual Studio 2005'/><category term='Freegle'/><category term='tag'/><category term='msitran'/><category term='gadget'/><category term='Windows'/><category term='settings'/><category term='open source'/><category term='applet'/><category term='MSI'/><category term='Sort'/><category term='live spaces'/><category term='Ajax'/><category term='Forms authentication'/><category term='Multiboot'/><category term='ASP.NET'/><category term='live.com'/><category term='module'/><category term='asp:HyperLink'/><category term='Visual Studio 2008'/><category term='accessibility'/><category term='Web Setup'/><category term='orca'/><category term='liquid'/><category term='tag-aware'/><category term='SQL server'/><category term='virtual tour'/><category term='DNN'/><category term='Apache'/><category term='mashup'/><category term='JSON'/><category term='vtiger'/><category term='IE7'/><category term='text size'/><category term='Merge'/><category term='boot'/><category term='XMP'/><category term='multi-boot'/><category term='CSS'/><category term='cookies'/><category term='JPEG'/><category term='EasyBCD'/><category term='Find-in-files'/><category term='tabindex'/><category term='font'/><category term='Java'/><category term='cookieless'/><category term='IIS'/><category term='Google'/><category term='.net string UTF8'/><category term='VS2008'/><category term='Drupal'/><category term='Tomcat'/><category term='photo'/><category term='integration'/><category term='custom'/><category term='Array'/><category term='.NET ASP.NET'/><category term='DotNetNuke'/><category term='skin'/><category term='netvibes'/><category term='VPS'/><category term='CMS'/><category term='JavaScript Object Notation'/><category term='custom module'/><category term='IE'/><category term='BCD'/><category term='Internet Explorer'/><category term='Ubuntu'/><category term='command line'/><category term='ViewState'/><category term='Custom Action'/><category term='maps'/><category term='JavaScript'/><category term='widget'/><category term='.NET'/><title type='text'>Comments on Chris Cant's developer blog: System.String hidden UTF8 BOM</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chriscant.phdcc.com/feeds/4581709963362320971/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32442424/4581709963362320971/comments/default'/><link rel='alternate' type='text/html' href='http://chriscant.phdcc.com/2010/02/systemstring-hidden-utf8-bom.html'/><author><name>Chris Cant</name><uri>http://www.blogger.com/profile/11367082039820244178</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://bp0.blogger.com/_hkkBsHR0r5s/SIidQwvn23I/AAAAAAAAABA/1Xq-6vG4S7g/S220/chris19.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-32442424.post-9100625037330811388</id><published>2010-03-03T19:10:45.106Z</published><updated>2010-03-03T19:10:45.106Z</updated><title type='text'>I find this behavior annoying. The Unicode specifi...</title><content type='html'>I find this behavior annoying. The Unicode specification states: &amp;quot;Where the data is typed, such as a field in a database, a BOM is unnecessary. Do not tag every string in a database or set of fields with a BOM, since it wastes space and complicates string&lt;br /&gt;concatenation. Moreover, it also means two data fields may have precisely the same content, but not be binary-equal (where one is prefaced by a BOM).&amp;quot; &lt;br /&gt;&lt;br /&gt;I also don&amp;#39;t like the fact that the behavior of GetString()/GetBytes() is predicated on whether the argument contains a BOM. If the byte array has any BOM in the first 2-3 bytes, then the returned string starts with the garbage character 0xFEFF (actually this is the UTF-16 BigEndian BOM). If there is no BOM in the byte array, then the string is well-formed. Likwise if you call GetBytes() with a string argument that has the 0xFEFF, the resulting byte array will contain a BOM (regardless of the encoding used to convert to bytes the BOM will always be correct). If the string has no garbage BOM, then there is no BOM in the byte array. Of course, then you have to prepend the BOM yourself. This behavior is a hidden mechanism that is not documented and more than a little annoying as it can screw thing up (like two BOMs in a file).</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32442424/4581709963362320971/comments/default/9100625037330811388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32442424/4581709963362320971/comments/default/9100625037330811388'/><link rel='alternate' type='text/html' href='http://chriscant.phdcc.com/2010/02/systemstring-hidden-utf8-bom.html?showComment=1267643445106#c9100625037330811388' title=''/><author><name>William</name><uri>http://www.sourcespringsoftware.com</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://chriscant.phdcc.com/2010/02/systemstring-hidden-utf8-bom.html' ref='tag:blogger.com,1999:blog-32442424.post-4581709963362320971' source='http://www.blogger.com/feeds/32442424/posts/default/4581709963362320971' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1218362779'/></entry></feed>
