aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb b/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb
index 6ca043ae21..e4ef98f1b6 100644
--- a/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb
+++ b/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb
@@ -316,8 +316,8 @@ module ActiveSupport::Multibyte::Handlers #:nodoc:
# Used to translate an offset from bytes to characters, for instance one received from a regular expression match
def translate_offset(str, byte_offset)
- return 0 if str == ''
return nil if byte_offset.nil?
+ return 0 if str == ''
chunk = str[0..byte_offset]
begin
begin