{"id":6368,"date":"2016-03-11T13:24:36","date_gmt":"2016-03-11T12:24:36","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/hayek\/jochen\/wp\/blog-en\/?p=6368"},"modified":"2016-03-11T13:24:36","modified_gmt":"2016-03-11T12:24:36","slug":"i-diffed-gnu-diffutils-two-rdp-files-utf-16-and-i-falsely-got-the-impression-these-utilities-properly-deal-with-unicode","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2016\/03\/11\/i-diffed-gnu-diffutils-two-rdp-files-utf-16-and-i-falsely-got-the-impression-these-utilities-properly-deal-with-unicode\/","title":{"rendered":"I diffed (GNU diffutils) two &#8220;.rdp&#8221; files (UTF-16), and I falsely got the impression these utilities properly deal with Unicode"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Remote_Desktop_Protocol\">https:\/\/en.wikipedia.org\/wiki\/Remote_Desktop_Protocol<\/a>\u00a0&#8212; originally from the Windows world RDP &#8220;<em>provides a user with a graphical interface to connect to another computer over a network connection<\/em>&#8220;<\/li>\n<li><a href=\"http:\/\/www.donkz.nl\/files\/rdpsettings.html\">http:\/\/www.donkz.nl\/files\/rdpsettings.html<\/a>\u00a0&#8212; a(n)\u00a0&#8220;.rdp&#8221; file keeps settings to start an RDP connection &#8212; because Emacs opens such files as text files, I had no idea they are not &#8220;classic&#8221; text files, instead (according to the GNU &#8220;file&#8221; command) they are &#8220;<em>little-endian UTF-16 Unicode text, with CRLF, CR line terminators<\/em>&#8221; (at least the ones created by Windows&#8217; &#8220;<em>Remote Desktop Connection<\/em>&#8221; software; I converted one of them to plain ASCII, and even through this one Windows still \u00a0opened the connection properly)<\/li>\n<\/ul>\n<p>My next &#8220;mistake&#8221; was to naively &#8220;<code>diff<\/code>&#8221; two &#8220;.rdp&#8221; files and to overcome some initial problem by passing &#8220;<code>--text<\/code>&#8221; to &#8220;<code>diff<\/code>&#8220;, and then &#8220;<code>diff<\/code>&#8221; showed exactly what I expected:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.gnu.org\/software\/diffutils\/manual\/html_node\/Binary.html\">https:\/\/www.gnu.org\/software\/diffutils\/manual\/html_node\/Binary.html<\/a>\u00a0&#8212; GNU diffutils&#8217; &#8220;<code>--text<\/code>&#8221; makes diff &#8220;<em>treat all files as text<\/em>&#8220;<\/li>\n<\/ul>\n<p>The respective work environment is Win7, and I am using GNU diffutils etc as part of Cygwin.\t\t\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/en.wikipedia.org\/wiki\/Remote_Desktop_Protocol\u00a0&#8212; originally from the Windows world RDP &#8220;provides a user with a graphical interface to connect to another computer over a network connection&#8220; http:\/\/www.donkz.nl\/files\/rdpsettings.html\u00a0&#8212; a(n)\u00a0&#8220;.rdp&#8221; file keeps settings to start an RDP connection &#8212; because Emacs opens such files as text files, I had no idea they are not &#8220;classic&#8221; text files, instead (according to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false,"_share_on_mastodon":"0"},"categories":[82,347],"tags":[],"class_list":["post-6368","post","type-post","status-publish","format-standard","hentry","category-cygwin","category-microsoft-windows"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-1EI","jetpack_likes_enabled":true,"amp_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=6368"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6368\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=6368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=6368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=6368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}