Permalink
Browse files

Fixed errors from changing to default ascii-8bit encoding.

  • Loading branch information...
1 parent 890efde commit 0d5f8eac902030bddbe8410be31dd7e28f86bdce @brixen brixen committed Oct 31, 2012
Showing with 5 additions and 3 deletions.
  1. +1 −1 kernel/common/integer19.rb
  2. +4 −2 lib/compiler/compiled_file.rb
@@ -13,7 +13,7 @@ def chr(enc=undefined)
raise RangeError, "#{self} is outside of the valid character range"
end
elsif self < 0x80
- return String.pattern(1, self)
+ enc = Encoding::US_ASCII
else
enc = Encoding::ASCII_8BIT
end
@@ -255,10 +255,12 @@ def marshal(val)
# marshaling an Encoding name as a String.
name = val.encoding.name
enc_name = "E\n#{name.bytesize}\n#{name}\n"
+ else
+ # The kernel code is all US-ASCII. When building melbourne for 1.8
+ # Ruby, we fake a bunch of encoding stuff so force US-ASCII here.
+ enc_name = "E\n8\nUS-ASCII\n"
end
- enc_name ||= "E\n0\n\n"
-
"s\n#{enc_name}#{val.bytesize}\n#{val}\n"
when Symbol
s = val.to_s

1 comment on commit 0d5f8ea

Owner

dbussink commented on 0d5f8ea Nov 3, 2012

See #1982

Please sign in to comment.