控制台中的 utf-8 序列

vde*_*nne 3 unicode console tree

当我在控制台中执行“树”命令时,这就是我所得到的:

.
??? Annexe\ 1\ -\ Sch\303\251ma\ global\ de\ la\ base\ de\ donn\303\251es.raw
...
Run Code Online (Sandbox Code Playgroud)

结果由 utf-8 序列组成,我需要以人类可读的形式获取报告的字符串。我怎样才能转换那个讨厌的东西?

slm*_*slm 6

您可以指定希望它与--charset开关一起使用的任何字符集。

   --charset charset
          Set the character set to use when outputting HTML and for line 
          drawing.
Run Code Online (Sandbox Code Playgroud)

还有这两个开关可能会有所帮助:

   -q     Print non-printable characters in filenames as question marks 
          instead of the default.

   -N     Print non-printable characters as is instead of as escaped octal 
          numbers.
Run Code Online (Sandbox Code Playgroud)

您也可以使用这些开关来增加输出:

   -A     Turn on ANSI line graphics hack when printing the indentation 
          lines.

   -S     Turn on ASCII line graphics (useful when using Linux console mode 
          fonts). This option is now equivalent to `--charset=IBM437' and 
          may eventually be depreciated.
Run Code Online (Sandbox Code Playgroud)