diff --git a/src/string.cr b/src/string.cr index e9dd8ab19347..49120fbe0288 100644 --- a/src/string.cr +++ b/src/string.cr @@ -1317,7 +1317,7 @@ class String return String.new(bytesize) do |buffer| bytesize.times do |i| byte = to_unsafe[i] - buffer[i] = byte < 0x80 ? byte.unsafe_chr.downcase.ord.to_u8! : byte + buffer[i] = 'A'.ord <= byte <= 'Z'.ord ? byte + 32 : byte end {@bytesize, @length} end @@ -1353,7 +1353,7 @@ class String return String.new(bytesize) do |buffer| bytesize.times do |i| byte = to_unsafe[i] - buffer[i] = byte < 0x80 ? byte.unsafe_chr.upcase.ord.to_u8! : byte + buffer[i] = 'a'.ord <= byte <= 'z'.ord ? byte - 32 : byte end {@bytesize, @length} end