lib/locale/driver/posix.rb in locale-2.0.1 vs lib/locale/driver/posix.rb in locale-2.0.2
- old
+ new
@@ -9,11 +9,11 @@
Original: Ruby-GetText-Package-1.92.0.
$Id: posix.rb 27 2008-12-03 15:06:50Z mutoh $
=end
-require 'locale/driver/env'
+require File.join(File.dirname(__FILE__), 'env')
module Locale
# Locale::Driver::Posix module for Posix OS (Unix)
# Detect the user locales and the charset.
# This is a low-level class. Application shouldn't use this directly.
@@ -28,17 +28,17 @@
def locales
::Locale::Driver::Env.locales
end
# Gets the charset from environment variable or the result of
- # "locale charmap".
+ # "locale charmap" or nil.
# * Returns: the system charset.
def charset
charset = ::Locale::Driver::Env.charset
unless charset
charset = `locale charmap`.strip
unless $? && $?.success?
- charset = "UTF-8"
+ charset = nil
end
end
charset
end
end