lib/et-orbi.rb in et-orbi-1.1.4 vs lib/et-orbi.rb in et-orbi-1.1.5
- old
+ new
@@ -7,11 +7,11 @@
require 'et-orbi/zone_aliases'
module EtOrbi
- VERSION = '1.1.4'
+ VERSION = '1.1.5'
#
# module methods
class << self
@@ -748,10 +748,14 @@
def get_offset_tzone(str)
# custom timezones, no DST, just an offset, like "+08:00" or "-01:30"
- m = str.match(/\A([+-][0-1][0-9]):?([0-5][0-9])?\z/)
+ m = str.match(/\A([+-][0-1][0-9]):?([0-5][0-9])?\z/) rescue nil
+ #
+ # On Windows, the real encoding could be something other than UTF-8,
+ # and make the match fail
+ #
return nil unless m
hr = m[1].to_i
mn = m[2].to_i