Module: Locale::Driver::Win32

### Home Classes Methods

### In Files

- lib/locale/driver/win32.rb

### Namespace

- MODULE Locale::Driver::Win32::Kernel32

### Methods

- #charset

### Included Modules

- Locale::Driver::Win32Table

### Class/Module Index

Quicksearch

- Locale
- Locale::Driver
- Locale::Driver::CGI
- Locale::Driver::Env
- Locale::Driver::JRuby
- Locale::Driver::Posix
- Locale::Driver::Win32
- Locale::Driver::Win32::Kernel32
- Locale::Driver::Win32Table
- Locale::Info
- Locale::Info::Language
- Locale::Info::Region
- Locale::Middleware
- Locale::Tag
- Locale::Tag::Cldr
- Locale::Tag::Common
- Locale::Tag::Irregular
- Locale::Tag::Posix
- Locale::Tag::Rfc
- Locale::Tag::Simple
- Locale::TagList
- Locale::Util
- Locale::Util::Memoizable

No matching classes.

# Locale::Driver::Win32

### Public Instance Methods

charset() click to toggle source

Gets the Win32 charset of the locale.

    # File lib/locale/driver/win32.rb, line 47
    def charset
      charset = ::Locale::Driver::Env.charset
      unless charset
        if locales
          tag = locales[0].to_rfc.to_s
          loc = LocaleTable.find{|v| v[1] == tag}
          loc = LocaleTable.find{|v| v[1] =~ /^#{locales[0].language}/} unless loc
          charset = loc ? loc[2] : nil
        else
          charset = "CP1252"
        end
      end
      charset
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.