On Sunday 02 August 2009, IƱaki Baz Castillo wrote: > |Hi, is it an appropiate list for asking about QtRuby? > | > |Note the following issue: > | > |---------------------- > |~# export LANG=es_ES.UTF-8 > | > |~# irb1.8 > | > |irb> require "Qt4" > | > |irb> num = 1.1 > |irb> puts num > |1.1 > | > |irb> app = Qt::Application.new(ARGV) > |#<Qt::Application:0x7f48392e6a70 objectName="irb1.8"> > | > |irb> puts num > |1,1 > |---------------------- > | > |As you can see, after creating a Qt::Application instance, FixNum#to_s has > |been overriden and prints the number in a format depending on user's > | LOCALES (in Spanish 1.1 is displayed as 1,1). > | > |I've critical issues with it because I use some external libraries as > |httpclient which creates wrong HTTP request after creating a instace of > |Qt::Application: > | > | GET /index.html HTTP/1,1 <--- Note 1,1 !!! > | > | > |Is there any way to disable this behaviour in QtRuby? any workaround? > |Thanks a lot. > | You can certainly post QtRuby related questions here, but probably you'll get more answers using the qtruby mailing list kde-bindings / kde.org or the qtruby forum: http://rubyforge.org/forum/forum.php?forum_id=723. Regarding your question, you can find an explaination of why this happens (and some workarounds) in this thread of the qtruby forum: http://rubyforge.org/forum/message.php?msg_id=67059 If you only want a quick solution, you can do the following: create a Qt::Locale object based on the C locale using Qt::Locale.c, sets its number_options property to Qt::Locale::OmitGroupSeparator and use its to_string method to create the string. Something like this: x = 1234.567 l = Qt::Locale.c l.number_options = Qt::Locale::OmitGroupSeparator puts l.to_string(x) Without changing the number_options property, you'll get a number separatorn the string (in the example, you'd get the string "1,234.567"). I hope this helps Stefano