<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>imaizumimr</author_name>
  <author_url>https://blog.hatena.ne.jp/imaizumimr/</author_url>
  <blog_title>Eggshell</blog_title>
  <blog_url>https://imaizumimr.hatenablog.com/</blog_url>
  <categories>
    <anon>文字コード</anon>
    <anon>Ruby</anon>
  </categories>
  <description>Ruby の String#force_encoding は String の encoding を変更するだけで、文字コードの変換を行うわけではありません。そのため、バイト列は変換されません。 force_encoding はどんなメソッドか String の encoding を変更します。ただし、バイト列は変更せず、encoding に対しバイト列が正しいかどうかは確認しません。 例えば あ を EUC-JP に変換して encode と比較します。 'あ'.encode(Encoding::EUC_JP).encoding # =&gt; #&lt;Encoding:EUC-JP&gt; 'あ'.for…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fimaizumimr.hatenablog.com%2Fentry%2F2022%2F01%2F31%2F203637&quot; title=&quot;String#force_encodingは文字コードの強制変換ではない - Eggshell&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>2022-01-31 20:36:37</published>
  <title>String#force_encodingは文字コードの強制変換ではない</title>
  <type>rich</type>
  <url>https://imaizumimr.hatenablog.com/entry/2022/01/31/203637</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
