Closed Bug 1419922 Opened 7 years ago Closed 2 years ago

Set "HGENCODING=utf-8" within MozillaBuild

Categories

(Firefox Build System :: MozillaBuild, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: xidorn, Assigned: mhentges)

References

Details

Attachments

(1 file, 1 obsolete file)

When I run
> hg import https://reviewboard-hg.mozilla.org/gecko/rev/1040f13fa3fcab02005c56d0befb78f173a8fb18

It fails with
> abort: decoding near 'io Cobos Álvarez <e': 'charmap' codec can't decode byte 0x81 in position 14: character maps to <undefined>!

This is because emilio's name contains a non-ASCII character "Á". (This is definitely not the first time I hit this :/)

Looking at Mercurial's code, it seems to be picking encoding with the following code:
> try:
>     encoding = environ.get("HGENCODING")
>     if not encoding:
>         encoding = locale.getpreferredencoding().encode('ascii') or 'ascii'
>         encoding = _encodingfixers.get(encoding, lambda: encoding)()
> except locale.Error:
>     encoding = 'ascii'

It's not completely clear to me what it means, but if I set HGENCODING to UTF-8, then the command can complete successfully.

I'm not sure whether it is something MozillaBuild should contain a fix for, or that Mercurial should fix for Windows.
Blocks: 1725895
Summary: hg apply aborts when changelog contains non-ASCII character on Windows → Set "HGENCODING=utf-8" within MozillaBuild
Assignee: nobody → mhentges
Status: NEW → ASSIGNED

Most power-users will likely want to use another editor, but now it will
be easier for new developers to get started.

Comment on attachment 9256650 [details]
Bug 1419922: Use "nano" as the default editor

Revision D134575 was moved to bug 1739443. Setting attachment 9256650 [details] to obsolete.

Attachment #9256650 - Attachment is obsolete: true

Rather than falling back to the Windows system encoding, use UTF-8.
This provides benefits such as allowing accents in author names.

Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/mozilla-build/rev/6e29d1cfa023
Configure mercurial to use UTF-8 r=glandium

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Product: mozilla.org → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: