* 100 ascii_long = "Hello, World! " * 100 mixed = "Hello こんにちは " * 100 # For each_char / chars - iterates character by character through encoding layer utf8_chars = "あいうえおかきくけこ" * 100 # --- Regression-focused cases for rb_str_inspect UTF-8 fast path --- # Tiny strings — overhead of the added fast-path branch / coderange check str_empty = "" str_1ascii = "a" str_1utf8 = "あ" # Non-UTF-8 encodings: must take the generic path — should NOT regress binary_long = ("Hello, World! " * 100).b us_ascii_long = ("Hello, World! " * 100).force_encoding("US-ASCII") # eucjp_long = ("こんにちは世界!" * 100).encode("EUC-JP") # sjis_long = ("こんにちは世界!" * 100).encode("Shift_JIS") # utf16le_long = ("こんにちは世界!" * 100).encode("UTF-16LE") # Broken UTF-8 (coderange BROKEN → generic path) broken_utf8 = ("\xFF".b * 1000).force_encoding("UTF-8") ...