<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gom68</author_name>
  <author_url>https://blog.hatena.ne.jp/gom68/</author_url>
  <blog_title>gom68の日記</blog_title>
  <blog_url>https://gom.hatenablog.com/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>Macでテキストファイルを保存すると、改行コードがLFで保存される。 ただ、Windowsに渡さなければ行けない時にちょっと面倒。 dos2unix というコマンドもあるらしいが、あえてRubyで変換してみる。 正規表現でいけるかと思ったが、なんかうまくいかないので require 'nkf' path = ARGV[0] s = &quot;&quot; File.open(path, 'r') do |f| f.each do |line| s &lt;&lt; NKF.nkf(&quot;--windows&quot;, line) end end File.open(path, 'w') do |f| f.puts s end nkf万…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgom.hatenablog.com%2Fentry%2F20090213%2F1234519344&quot; title=&quot;改行コードLFをCR+LFに変換する - gom68の日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-02-13 19:02:24</published>
  <title>改行コードLFをCR+LFに変換する</title>
  <type>rich</type>
  <url>https://gom.hatenablog.com/entry/20090213/1234519344</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
