<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ok2nd</author_name>
  <author_url>https://blog.hatena.ne.jp/ok2nd/</author_url>
  <blog_title>中級プログラマの自宅でPHP ブログ</blog_title>
  <blog_url>https://ok2nd.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>Google App Engine備忘録。 Pythonではutf-8とUnicodeは別物らしい。 utf-8のままでは、文字単位で正しく文字列処理をしてくれない。Unicodeにすれば、正しく処理される。 utf-8の日本語文字列から、一部を取り出す場合、結構面倒。 ≪例≫ utf8 = str.encode('utf-8') html = '&lt;td&gt;'+utf8[:5]+'&lt;/td&gt;' では、asciiとしてバイト単位で取り出すため、文字化けする。 utf8 = str.encode('utf-8') html = '&lt;td&gt;'+unicode(utf8,'utf-8')[:5].enc…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fok2nd.hatenablog.com%2Fentry%2F2011%2F08%2F30%2F181738&quot; title=&quot;Google App Engine：utf-8の文字列切り出し - 中級プログラマの自宅でPHP ブログ&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>2011-08-30 18:17:38</published>
  <title>Google App Engine：utf-8の文字列切り出し</title>
  <type>rich</type>
  <url>https://ok2nd.hatenablog.com/entry/2011/08/30/181738</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
