[fxruby-users] FXApp & Time localization

Philippe Lang philippe.lang at attiksystem.ch
Tue Dec 4 03:53:29 EST 2007


Philippe Lang wrote:
> Hi,
> 
> Here is small test program:
> 
> ----------------
> require 'rubygems'
> require 'fox16'
> 
> puts Time.now
> 
> $app = Fox::FXApp.new
> 
> puts Time.now
> ----------------
> 
> Here is what it gives on my computer:
> 
> ----------------
> Tue Dec 04 08:40:14 +0100 2007
> mar. dÚc. 04 08:40:14 +0100 2007
> ----------------
> 
> After FXApp is instanciated, the Time class is suddenly being
> localized, and this breaks a few things elsewhere in my program. 
> 
> I'm a french speaker, and second line means that the week day is
> "mardi", and month is "décembre". Unfortunately, "é" is not printed
> correctly in my windows console. You get this "Ú" instead.  
> 
> Can anyone tell me me what happens here? Is there a workaround?

I have found a workaround with class DateTime, instead of Time:

----------------
require 'rubygems'
require 'fox16'

puts DateTime.now

$app = Fox::FXApp.new

puts DateTime.now
----------------

This gives:

----------------
2007-12-04T09:23:35+01:00
2007-12-04T09:23:35+01:00
----------------

... which looks better!

Philippe


More information about the fxruby-users mailing list