{"id":5200,"date":"2014-03-30T19:33:48","date_gmt":"2014-03-30T19:33:48","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/java-create-inputstreamreader-object-from-inputstream-collection-of-common-programming-errors\/"},"modified":"2014-03-30T19:33:48","modified_gmt":"2014-03-30T19:33:48","slug":"java-create-inputstreamreader-object-from-inputstream-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/java-create-inputstreamreader-object-from-inputstream-collection-of-common-programming-errors\/","title":{"rendered":"java create InputStreamReader object from InputStream-Collection of common programming errors"},"content":{"rendered":"<p>No, Java does not usually automagically transform one character set into another, <em>especially<\/em> if you tell it explicitly which character set to use.<\/p>\n<p>The thing is, however that UTF-8 is ASCII-compatible. That means that every valid ASCII stream is automatically a valid UTF-8 stream as well and that text containing only ASCII-characters encoded in UTF-8 is also valid ASCII.<\/p>\n<p>So if you plan to accept only ASCII and UTF-8 input, then treating it all as UTF-8 is perfectly valid. If you plan to support other encodings as well, then you&#8217;ll need some way to transmit the information about the actual encoding being used as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>No, Java does not usually automagically transform one character set into another, especially if you tell it explicitly which character set to use. The thing is, however that UTF-8 is ASCII-compatible. That means that every valid ASCII stream is automatically a valid UTF-8 stream as well and that text containing only ASCII-characters encoded in UTF-8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5200","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5200"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5200\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}