<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>methane</author_name>
  <author_url>https://blog.hatena.ne.jp/methane/</author_url>
  <blog_title>methaneのブログ</blog_title>
  <blog_url>https://methane.hatenablog.jp/</blog_url>
  <categories>
  </categories>
  <description>Pythonの内部処理で、与えられたUTF-8の文字列がASCII文字のみを含むかをテストするコードを書いています。 size_t型が8バイトの時、ポインタを char* から size_t* にキャストして、0x8080808080808080ullと論理積を取れば8バイトを一度に処理できます。 単純化すると次のようなコードになります。 #define ASCII_MASK 0x8080808080808080ull size_t find_first_nonascii(const char *start, const char *end) { const char *p = start; …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmethane.hatenablog.jp%2Fentry%2F2024%2F10%2F28%2F162612&quot; title=&quot;小さい文字列からASCII外のバイトを見つけたい - methaneのブログ&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>2024-10-28 16:26:12</published>
  <title>小さい文字列からASCII外のバイトを見つけたい</title>
  <type>rich</type>
  <url>https://methane.hatenablog.jp/entry/2024/10/28/162612</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
