<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>potisan</author_name>
  <author_url>https://blog.hatena.ne.jp/potisan/</author_url>
  <blog_title>potisanのプログラミングメモ</blog_title>
  <blog_url>https://potisan-programming-memo.hatenablog.jp/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>Ruby 2</anon>
  </categories>
  <description>本文 有名事項なのかもしれませんが、Win32APIを使って固定長文字列を含む構造体を扱おうとした時に文字化け（？）して手間取ったのでメモです。 結論としてはunpack(&quot;A*&quot;)の返す文字列がASCII-8BITであることが原因だったので、 String::force_encoding('SJIS') （文字コードがShift-JISのとき） or String::force_encoding('SJIS').encode('UTF-8') （文字コードがUTF-8のとき） で解決しました。 以下のサンプルコードはWin32 APIのmixerGetDevCapsA関数を呼び出して引数に使…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2014%2F01%2F03%2F000000&quot; title=&quot;Ruby 2.0.0とWin32APIで構造体内部の固定長文字列（char型）を扱う - potisanのプログラミングメモ&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>2014-01-03 00:00:00</published>
  <title>Ruby 2.0.0とWin32APIで構造体内部の固定長文字列（char型）を扱う</title>
  <type>rich</type>
  <url>https://potisan-programming-memo.hatenablog.jp/entry/2014/01/03/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
