Project

General

Profile

Actions

Bug #5855

closed

inconsistent treatment of 8 bit characters in US-ASCII

Bug #5855: inconsistent treatment of 8 bit characters in US-ASCII

Added by john_firebaugh (John Firebaugh) almost 14 years ago. Updated almost 14 years ago.

Status:
Closed
Target version:
-
ruby -v:
Backport:
[ruby-core:41949]

Description

=begin
Does Ruby allow 8 bit characters (127-255) in a US-ASCII encoded string, or not?

"\u{80}".encode("US-ASCII") #=> Encoding::UndefinedConversionError
0x80.chr("US-ASCII") #=> "\x80" (US-ASCII encoding)
"".encode("US-ASCII") << 128 #=> "\x80" (US-ASCII encoding)
"".encode("US-ASCII") << 128.chr #=> "\x80" (ASCII-8BIT encoding)
=end


Related issues 2 (0 open2 closed)

Related to Ruby - Bug #5863: Integer#chr may return a string with multiple charactersClosedActions
Related to Ruby - Bug #5864: Integer#chr raises on some invalid codepoints but returns an invalidly-encoded string for othersClosedActions
Actions

Also available in: PDF Atom