[ruby-core:127514] [Ruby Bug#22491] The number of captures may change depending on the encoding of the target string