Sha256: ec4f28777ec69b890b37739e1fb002e9912ab4cc38eb9a44c91d2a834df1fceb
Contents?: true
Size: 1.46 KB
Versions: 8
Compression:
Stored size: 1.46 KB
Contents
=begin locale_posix.rb Copyright (C) 2002-2006 Masao Mutoh You may redistribute it and/or modify it under the same license terms as Ruby. $Id: locale_posix.rb,v 1.1 2006/02/20 12:35:06 mutoh Exp $ =end module Locale # :nodoc: # Locale::SystemPosix module for Posix OS (Unix) # This is low-level class. Application shouldn't use this directly. module SystemPosix extend Locale::System module_function # Gets the system locale using setlocale and nl_langinfo. # * Returns the system locale (Locale::Object). def system old = set(Locale::System::CTYPE, nil) locale = Locale::Object.new(set(Locale::System::CTYPE, ""), nil, codeset) set(Locale::System::CTYPE, old) locale end # Gets the charset of the locale. # * locale: Locale::Object # * Returns: the charset of the locale def get_charset(locale) old = set(Locale::System::CTYPE, nil) set(Locale::System::CTYPE, locale.orig_str) ret = codeset set(Locale::System::CTYPE, old) ret end end if defined? Locale::System::CTYPE CTYPE = Locale::System::CTYPE #:nodoc: NUMERIC = Locale::System::NUMERIC #:nodoc: TIME = Locale::System::TIME #:nodoc: COLLATE = Locale::System::COLLATE #:nodoc: MONETARY = Locale::System::MONETARY #:nodoc: MESSAGES = Locale::System::MESSAGES #:nodoc: ALL = Locale::System::ALL #:nodoc: end @@locale_system_module = SystemPosix end
Version data entries
8 entries across 8 versions & 1 rubygems