lib/nanoc/cli/stream_cleaners/utf8.rb in nanoc-4.7.9 vs lib/nanoc/cli/stream_cleaners/utf8.rb in nanoc-4.7.10

- old
+ new

@@ -1,12 +1,17 @@ +# frozen_string_literal: true + module Nanoc::CLI::StreamCleaners # Simplifies output by replacing UTF-8 characters with their ASCII decompositions. # # @api private class UTF8 < Abstract # @see Nanoc::CLI::StreamCleaners::Abstract#clean def clean(s) # FIXME: this decomposition is not generally usable - s.tr('─┼“”‘’', '-+""\'\'').gsub('…', '...').gsub('©', '(c)') + s + .unicode_normalize(:nfkd) + .tr('─┼“”‘’', '-+""\'\'') + .gsub('©', '(c)') end end end