D3665: graph: improve graph output by using Unicode characters

quark (Jun Wu) phabricator at mercurial-scm.org
Sat Jun 16 03:38:41 EDT 2018


quark added a comment.


  In https://phab.mercurial-scm.org/D3665#58862, @johnstiles wrote:
  
  > Without more context I have no idea what you are trying to show. Windows is
  >  certainly capable of rendering Unicode characters in the console. It is
  >  also very possible to get ? characters if you're running a
  >  non-Unicode-aware tool or if there are encoding mix-up issues. "type con"
  >  and pasting in text from a text editor doesn't really prove anything one
  >  way or the other. (What editor? What encoding did it think the data was?
  >  How does "type con" handle Unicode text? etc.)
  >
  > Run the actual hgext and take a screenshot of what it generates if you want
  >  to give a more useful data point for us.
  
  
  Copy-pasting would render utf-8 characters correctly if the font supports them. It does not seem to be related to the current codepage.
  
  I edited the screenshot to show an explicit `type a-utf-8-file` with "utf-8" (65001) codepage, with different fonts.
  
  Note: Mercurial will raise "unknown encoding: cp65001" in this case so it's probably safe if you have the `encoding.encoding != 'utf8'` check. But anything rendered using the utf-8 characters (be it from "git bash hg -G ... > a.txt" or whatever POSIX-like shells) will render sub-optimally in cmd.exe.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3665

To: johnstiles, #hg-reviewers, spectral
Cc: quark, spectral, indygreg, smf, yuja, mercurial-devel


More information about the Mercurial-devel mailing list