# File lib/rbreadline.rb, line 8623
  def _rl_find_next_mbchar(string, seed, count, flags)
    if @encoding == 'N'
      return (seed + count)
    end
    seed = 0 if seed < 0
    return seed if count <= 0

    point = seed + _rl_adjust_point(string,seed)
    if (seed < point)
      count -= 1
    end

    str = (flags == MB_FIND_NONZERO) ? string.sub(/\x00+$/,'') : string

    case @encoding
    when 'E'
      point += str[point..-1].scan(/./me)[0,count].to_s.length
    when 'S'
      point += str[point..-1].scan(/./ms)[0,count].to_s.length
    when 'U'
      point += str[point..-1].scan(/./mu)[0,count].to_s.length
    when 'X'
      point += str[point..-1].force_encoding(@encoding_name)[0,count].bytesize
    else
      point += count
      point = str.length if point >= str.length
    end
    point
  end