2010年10月30日土曜日

ruby1.9.2 + qtbindings (4.6.3.1 x86-mingw32)


C:\rubyapi\Qt4>ruby -v
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]

C:\rubyapi\Qt4>gem list

*** LOCAL GEMS ***

minitest (1.6.0)
qtbindings (4.6.3.1 x86-mingw32)
rake (0.8.7)
rdiscount (1.6.5)
rdoc (2.5.8)
tk-win (0.2.2 x86-mingw32)

C:\rubyapi\Qt4>ruby gui_qtruby_spl1_sjis.rb

C:\rubyapi\Qt4>ruby gui_qtruby_spl1_utf8.rb

#####gui_qtruby_spl1_utf8.rb
#!ruby -Ku
# -*- coding:utf-8 -*-
require 'Qt4'

app = Qt::Application.new(ARGV)

#hello = Qt::PushButton.new('Hello World!')
hello = Qt::Label.new('こんにちは、世界!')
hello.window_title = 'Hello World! QtRuby utf-8'
hello.resize(260, 60)
hello.show()

app.exec()

####gui_qtruby_spl1_sjis.rb
#!ruby -Ks
# -*- coding:shift_jis -*-
require 'Qt4'

app = Qt::Application.new(ARGV)

#hello = Qt::PushButton.new('Hello World!')
hello = Qt::Label.new('こんにちは、世界!')
hello.window_title = 'Hello World! QtRuby shift_jis'
hello.resize(260, 60)
hello.show()

app.exec()

ruby1.9.2 + qtbindings
shift_jisは漢字表示できるのにutf-8 文字化けします。

ruby1.8.7 + qtbindings
shift_jisはSegmentation fault、utf-8 漢字表示できます。
C:\rubyapi\Qt4>ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]

C:\rubyapi\Qt4>ruby -rubygems gui_qtruby_spl1_sjis.rb
C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/qtbindings-4.6.3.1-x86-mingw32/lib/Qt/qtruby4.rb:2640: [BUG] Segmentation fault
ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

C:\rubyapi\Qt4>ruby -rubygems gui_qtruby_spl1_utf8.rb

C:\rubyapi\Qt4>


0 件のコメント:

コメントを投稿