{"id":1188,"date":"2011-03-31T15:45:52","date_gmt":"2011-03-31T14:45:52","guid":{"rendered":"http:\/\/www.galhano.com\/blog\/?p=1188"},"modified":"2011-03-31T15:47:46","modified_gmt":"2011-03-31T14:47:46","slug":"using-character-encoding-in-aspnet","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=1188","title":{"rendered":"Using Character Encoding in ASP.NET"},"content":{"rendered":"<p>Open the file named <code>web.config<\/code> in the <span class=\"search-highlight\">ASP.NET<\/span> project. The value of <code>request&lt;span class=&quot;search-highlight&quot;&gt;Encoding&lt;\/span&gt; <\/code>attribute in <code>globalization <\/code>element is &#8220;utf-8&#8221;. It means the requested texts were encoded as UTF-8 <span class=\"search-highlight\">character<\/span> set. Because SCO5.05 does not support UTF-8, therefore the requested texts where changed.<\/p>\n<p>VB:<\/p>\n<p>Public Shared Function unicode_iso8859(ByVal src As String) As String<br \/>\nDim iso As Encoding = Encoding.GetEncoding(&#8220;iso8859-1&#8221;)<br \/>\nDim unicode As Encoding = Encoding.UTF8<br \/>\nDim unicodeBytes As Byte() = unicode.GetBytes(src)<br \/>\nReturn iso.GetString(unicodeBytes)<br \/>\nEnd Function<\/p>\n<p>Public Shared Function iso8859_unicode(ByVal src As String) As String<br \/>\nDim iso As Encoding = Encoding.GetEncoding(&#8220;iso8859-1&#8221;)<br \/>\nDim unicode As Encoding = Encoding.UTF8<br \/>\nDim isoBytes As Byte() = iso.GetBytes(src)<br \/>\nReturn unicode.GetString(isoBytes)<br \/>\nEnd Function<\/p>\n<p>label1.Text =   iso8859_unicode(MyString)<\/p>\n<p>more details in http:\/\/www.codeproject.com\/KB\/aspnet\/Encoding_in_ASPNET.aspx<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Open the file named web.config in the ASP.NET project. The value of request&lt;span class=&quot;search-highlight&quot;&gt;Encoding&lt;\/span&gt; attribute in globalization element is &#8220;utf-8&#8221;. It means the requested texts were encoded as UTF-8 character set. Because SCO5.05 does not support UTF-8, therefore the requested texts where changed. VB: Public Shared Function unicode_iso8859(ByVal src As String) As String Dim iso [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"close","ping_status":"close","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,2,42],"tags":[],"class_list":["post-1188","post","type-post","status-publish","format-standard","hentry","category-code-snippets","category-truques-dicas","category-utils","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1188"}],"version-history":[{"count":4,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1188\/revisions"}],"predecessor-version":[{"id":1190,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1188\/revisions\/1190"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1188"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}