# File lib/rbreadline.rb, line 8682
  def _rl_compare_chars(buf1, pos1, buf2, pos2)
    return false if buf1[pos1].nil? || buf2[pos2].nil?
    case @encoding
    when 'E'
      buf1[pos1..-1].scan(/./me)[0] == buf2[pos2..-1].scan(/./me)[0]
    when 'S'
      buf1[pos1..-1].scan(/./ms)[0] == buf2[pos2..-1].scan(/./ms)[0]
    when 'U'
      buf1[pos1..-1].scan(/./mu)[0] == buf2[pos2..-1].scan(/./mu)[0]
    when 'X'
      buf1[pos1..-1].force_encoding(@encoding_name)[0] == buf2[pos2..-1].force_encoding(@encoding_name)[0]
    else
      buf1[pos1] == buf2[pos2]
    end
  end