Bug #3791

Ruby 1.9.2のReadline.readlineとReadline.line_bufferのエンコーディングの非互換

Added by Motohiro KOSAKI over 4 years ago. Updated almost 4 years ago.

Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 1.9.3dev Backport:

Description

=begin
http://emasaka.blog65.fc2.com/blog-entry-802.html からの転載です

$ cat foo.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'readline'

s = Readline.readline '> '
p s.encoding
p Readline.line_buffer.encoding
$ ruby foo.rb


#Encoding:UTF-8
#Encoding:ASCII-8BIT

Readline.readlineがロケールに従って文字コードを決定し、
Readline.line_buffer が常にASCII-8BITを返すのは意図的でしょうか?

ASCII-8BITのほうがcompletitonの実装が楽になるケースが今ひとつ
思いつかなかったのでチケット切らさせて頂きました。
=end

Associated revisions

Revision 29188
Added by Yui NARUSE over 4 years ago

  • ext/readline/readline.c (readline_s_get_line_buffer): Readline.line_buffer should return locale string. #3791

Revision 29188
Added by Yui NARUSE over 4 years ago

  • ext/readline/readline.c (readline_s_get_line_buffer): Readline.line_buffer should return locale string. #3791

History

#1 Updated by Yui NARUSE over 4 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r29188.
Motohiro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF