From: "nobu (Nobuyoshi Nakada)" Date: 2012-05-16T10:05:21+09:00 Subject: [ruby-core:45070] [ruby-trunk - Bug #6436] Byte counting incorrect in BufferedIO (net/protocol.rb) Issue #6436 has been updated by nobu (Nobuyoshi Nakada). File protocol.patch added Emacs diff-mode.el provides a function, diff-context->unified. ---------------------------------------- Bug #6436: Byte counting incorrect in BufferedIO (net/protocol.rb) https://bugs.ruby-lang.org/issues/6436#change-26649 Author: jcast (Jeremie Castagna) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: 1.9 BufferedIO's @rbuf counts bytes with String#size, but should use String#bytesize. This creates potential incorrect reading of a HTTP body when changing the encoding of each chuck passed by HTTP#read_body: http.read_body do |chunk| chunk.force_encoding "UTF-8" end -- http://bugs.ruby-lang.org/