<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>wilask (Wilask)</title>
    <link>https://ruby-china.org/wilask</link>
    <description>乐观看待一切</description>
    <language>en-us</language>
    <item>
      <title>Redmine 的编码问题</title>
      <description>&lt;p&gt;部署完 Redmine 后，新建中文的用户，提示 500 错误&lt;/p&gt;

&lt;p&gt;日志：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
    6: &amp;lt;fieldset class="box tabular"&amp;gt;
    7:   &amp;lt;legend&amp;gt;&amp;lt;%=l(:label_information_plural)%&amp;gt;&amp;lt;/legend&amp;gt;
    8:   &amp;lt;p&amp;gt;&amp;lt;%= f.text_field :login, :required =&amp;gt; true, :size =&amp;gt; 25  %&amp;gt;&amp;lt;/p&amp;gt;
    9:   &amp;lt;p&amp;gt;&amp;lt;%= f.text_field :firstname, :required =&amp;gt; true %&amp;gt;&amp;lt;/p&amp;gt;
    10:   &amp;lt;p&amp;gt;&amp;lt;%= f.text_field :lastname, :required =&amp;gt; true %&amp;gt;&amp;lt;/p&amp;gt;
    11:   &amp;lt;p&amp;gt;&amp;lt;%= f.text_field :mail, :required =&amp;gt; true %&amp;gt;&amp;lt;/p&amp;gt;
    12:   &amp;lt;% unless @user.force_default_language? %&amp;gt;
  lib/redmine/views/labelled_form_builder.rb:31:in `text_field'
  app/views/users/_form.html.erb:9:in `_app_views_users__form_html_erb___1339523949848742532_70169066250380'
  app/views/users/_general.html.erb:2:in `block in _app_views_users__general_html_erb__1484988381539933793_58512080'
  app/helpers/application_helper.rb:1056:in `labelled_form_for'
  app/views/users/_general.html.erb:1:in `_app_views_users__general_html_erb__1484988381539933793_58512080'
  app/views/common/_tabs.html.erb:22:in `block in _app_views_common__tabs_html_erb__1558437477300092939_57895140'
  app/views/common/_tabs.html.erb:21:in `each'
  app/views/common/_tabs.html.erb:21:in `_app_views_common__tabs_html_erb__1558437477300092939_57895140'
  app/helpers/application_helper.rb:328:in `render_tabs'
  app/views/users/edit.html.erb:9:in `_app_views_users_edit_html_erb__748188076281410297_58219660'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;环境：
Ubuntu14.04
Redmine2.6.0
Ruby2.0.0
Mysql5.5.40&lt;/p&gt;

&lt;p&gt;网上的方法试过一些，但不能解决问题。听说是要用 Ruby1.8 的版本。&lt;/p&gt;</description>
      <author>wilask</author>
      <pubDate>Thu, 08 Jan 2015 16:52:08 +0800</pubDate>
      <link>https://ruby-china.org/topics/23615</link>
      <guid>https://ruby-china.org/topics/23615</guid>
    </item>
    <item>
      <title>Python 读取注册表的问题，求助</title>
      <description>&lt;p&gt;这里高手多，在这里问了；&lt;/p&gt;

&lt;p&gt;在 Windows 2003 64 位系统上用 Python 读取注册表，代码：&lt;/p&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;UnInsKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;Key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_winreg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OpenKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_winreg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HKEY_LOCAL_MACHINE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;UnInsKey&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;为什么在 32 位系统上则成功，但在 64 位系统上则打开的是这个路径：&lt;code&gt;SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;为什么呢？？&lt;/p&gt;</description>
      <author>wilask</author>
      <pubDate>Wed, 23 Oct 2013 15:34:06 +0800</pubDate>
      <link>https://ruby-china.org/topics/14961</link>
      <guid>https://ruby-china.org/topics/14961</guid>
    </item>
  </channel>
</rss>
