Sha256: 61c3bb83a53a310727d97909c36c05352d4e47344989a907412577158c4207d3
Contents?: true
Size: 274 Bytes
Versions: 42
Compression:
Stored size: 274 Bytes
Contents
unless StringScanner.method_defined? :charpos class StringScanner def charpos if string.respond_to?(:byteslice) string.byteslice(0, pos).length else string.unpack("@0a#{pos}").first.force_encoding("UTF-8").length end end end end
Version data entries
42 entries across 42 versions & 2 rubygems