Truncate strings with fullwidth characters and ANSI codes.
No monkey-patching String classOmit text from the start, middle, end or both endsAccount for fullwidth characters in encodings such as UTF-8, EUC-JPShorten text without whitespaces between words (Chinese, Japanese, Korean etc)Preserve ANSI escape codes.
Truncate strings with fullwidth characters and ANSI codes. #ruby #rubydeveloper #rubyonrails #codes. https://rubyonrails.ba/single/truncate-strings-with-fullwidth-characters-and-ansi-codes