buggit2cl - Bugs: bug #65689, Warning "Wide character in...

 
 

bug #65689: Warning "Wide character in print"

Submitter:  R. Diez <rdiez>
Submitted:  Sun 05 May 2024 10:01:16 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  In Progress
Privacy:  Public Assigned to:  jas
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 13 Oct 2024 10:43:57 AM UTC, comment #2: 


> Thanks for the report!  Can you check if v3.0 solves this?


I tested the new HEAD version, and it looks fine.


> It had another UTF-8 related fix in it, and I no longer get the
> error message for OpenOCD


I don't know how you tested OpenOCD. The latest version has this patch of mine:

https://review.openocd.org/c/openocd/+/8262/2/Makefile.am

The PERL_UNICODE="IO" workaround would prevent the warning and generate correct UTF-8 output. I'll try to remove that workaround now that git2cl has been updated.


> however it looks a bit like the Unicode characters were garbled, maybe you had Latin-1 encoded in the git log?
> Not sure if this is still a git2cl problem or if it your git log history is bad (I believe 'git-log' enforces UTF-8 outputs these days).


Apparently, the character encoding is configurable per commit and globally, see the 'git-log' documentation. The output is UTF-8 by default.

If the OpenOCD guys had any wrong or faulty encoding in the commit log, then we would have noticed. I think the main problem is that Perl does not use UTF-8 by default on stdin or stdout. But that is now fixed in git2cl.


If git2cl now expects UTF-8, the safest way would be to a) document it, and b) pass configuration option i18n.logOutputEncoding to 'git log' if git2cl is running that command itself.


By the way, I would change ":utf8" to ":encoding(UTF-8)" (with capital letters) in git2cl. Otherwise, we may not notice character encoding issues in the future. You can find details about the different UTF-8 error handling strategies here:

https://stackoverflow.com/questions/49038533/using-encodeencode-with-utf8

R. Diez <rdiez>
Wed 09 Oct 2024 04:44:53 PM UTC, comment #1: 

Thanks for the report!  Can you check if v3.0 solves this?  It had another UTF-8 related fix in it, and I no longer get the error message for OpenOCD -- however it looks a bit like the Unicode characters were garbled, maybe you had Latin-1 encoded in the git log?  Not sure if this is still a git2cl problem or if it your git log history is bad (I believe 'git-log' enforces UTF-8 outputs these days).

Simon Josefsson <jas>
Group administrator
Sun 05 May 2024 10:01:16 AM UTC, original submission:  

When making "make distcheck" in OpenOCD, I saw warnings like these:

Wide character in print at ./tools/git2cl/git2cl line 339, <GEN0> line 15138.
Wide character in print at ./tools/git2cl/git2cl line 339, <GEN0> line 30233.
Wide character in print at ./tools/git2cl/git2cl line 339, <GEN0> line 31235.

The same warnings come up too when running git2cl manually.

This is an implementation problem in git2cl. Command "git log" outputs UTF-8 by default, see option "--encoding=<encoding>" in "git log", and the user probably wants to generate the ChangeLog file as UTF-8 too. Therefore, git2cl should change the stdio and stdout encodings to UTF-8.

A workaround is to set environment PERL_UNICODE="IO" before running git2cl.

Without fixing the code or using the workaround, the generated ChangeLog file may end up with the wrong character encoding.

R. Diez <rdiez>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jas (Posted a comment)
  • -email is unavailable- added by rdiez (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-10-09 jas Assigned toNone jas
    2024-10-09 jas StatusNone In Progress

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code