<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takamizawa46</author_name>
  <author_url>https://blog.hatena.ne.jp/takamizawa46/</author_url>
  <blog_title>やわらかテック</blog_title>
  <blog_url>https://www.okb-shelf.work/</blog_url>
  <categories>
    <anon>清流elixir</anon>
    <anon>computer science</anon>
    <anon>Erlang</anon>
    <anon>Elixir</anon>
  </categories>
  <description>事の発端 たまたまElixirでhttp responseのbinary情報に対して、特定の日本語が含まれているかという判定式を記述していたところで、この現象に遭遇した。 iex&gt; body = &lt;&lt;201, 202, 197, ...&gt;&gt; iex&gt; String.contains?(body, &quot;いちご&quot;) false 間違いなくbinaryの中には第2引数で渡している日本語ひらがな(内部データ的にはこいつもbinary)が含まれているのになぜかfalseになる。この一件をtwitterにて投下したところ、KIKUCHI Yutaka 🌓 菊池 豊さんとこの動作について議論をしたが、なぜそう…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.okb-shelf.work%2Fentry%2Fwhy_string_contains&quot; title=&quot;ElixirのString.contains?で第1引数にbinaryを第2引数に日本語ひらがなを与えるとfalseになる理由についての調査報告 - やわらかテック&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>https://cdn-ak.f.st-hatena.com/images/fotolife/t/takamizawa46/20210828/20210828085458.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-02-05 09:37:21</published>
  <title>ElixirのString.contains?で第1引数にbinaryを第2引数に日本語ひらがなを与えるとfalseになる理由についての調査報告</title>
  <type>rich</type>
  <url>https://www.okb-shelf.work/entry/why_string_contains</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
