aboutsummaryrefslogtreecommitdiff
path: root/date_locale.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2014-11-13 00:30:39 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2014-11-13 00:30:39 +0100
commit853dc8b41fc70b3fc85930481bf95e1dfcaba90c (patch)
treec217614fbd3707b921408065e30869e8f1e08238 /date_locale.rb
parentdaaa0829051485d0c34f773ddfaeb71be9072158 (diff)
port to ruby2.1
Diffstat (limited to 'date_locale.rb')
-rw-r--r--date_locale.rb21
1 files changed, 1 insertions, 20 deletions
diff --git a/date_locale.rb b/date_locale.rb
index 6839b58..9108084 100644
--- a/date_locale.rb
+++ b/date_locale.rb
@@ -7,7 +7,6 @@
#
-require 'iconv'
require 'date'
#
@@ -165,20 +164,6 @@ module Date_locale
return DATE_TEXTS[lang]
end
- #Set default converter
- #~ @@encoding_converter = Iconv.new( 'iso-8859-1', 'utf-8' )
-
- #
- #The daynames are encoded in UTF (I hope ;-) ).
- #With this method you can define a global converter.
- #
- #Example:
- # Date_locale.set_target_encoding( 'iso-8859-1')
- #
- def self.set_target_encoding( enc )
- @@encoding_converter = Iconv.new( enc, 'utf-8' )
- end
-
#
#Get the key for the wanted language.
@@ -245,11 +230,7 @@ module Date_locale
end
}
)
- if defined? @@encoding_converter
- @@encoding_converter.iconv(result)
- else
- result
- end
+ result.encode("utf-8")
end #strftime_locale(format = '%F', lang = :en )
end #module Date_locale