How to configure the Command Prompt to display French correctly

command linelocalization

Observe the following snippet:

PS Z:\dev\windows\nc\NC.ProtoBuf> hg help qimport
hg qimport [-e] [-n NOM] [-f] [-g] [-P] [-r REV]... FICHIER...

importe un patch

    Le patch est insÚrÚ dans la sÚrie Ó la suite du dernier patch appliquÚ. Si
    aucun patch n'a encore ÚtÚ appliquÚ, le patch sera ajoutÚ en tÛte de
    sÚrie.

    Le patch portera le mÛme nom que le fichier dont il provient, Ó moins
    qu'un autre nom ne soit spÚcifiÚ Ó l'aide de -n/--name.

    Vous pouvez enregistrer un patch dÚjÓ prÚsent dans le rÚpertoire de patchs
    Ó l'aide de l'option -e/--existing.

As one can see the output is mangled in this French output. For instance, dÚjÓ should be déjà. I utilize both cmd.exe and PowerShell – the result is the same.

Is there any way to configure the Command Prompt to render the French accents properly?

EDIT

Following an advice from https://superuser.com/users/52492/redgrittybrick I have tried PowerShell ISE – still no love:

_____________________________________________________________________________________
PS Z:\> hg help qimport
hg qimport [-e] [-n NOM] [-f] [-g] [-P] [-r REV]... FICHIER...

importe un patch

    Le patch est insÚrÚ dans la sÚrie Ó la suite du dernier patch appliquÚ.
    Si aucun patch n'a encore ÚtÚ appliquÚ, le patch sera ajoutÚ en tÛte de
    sÚrie.

    Le patch portera le mÛme nom que le fichier dont il provient, Ó moins
    qu'un autre nom ne soit spÚcifiÚ Ó l'aide de -n/--name.

    Vous pouvez enregistrer un patch dÚjÓ prÚsent dans le rÚpertoire de
    patchs Ó l'aide de l'option -e/--existing.

    Avec -f/--force, un patch dÚjÓ prÚsent du mÛme nom sera ÚcrasÚ.

EDIT 2

I am pretty sure, that there is no problem with the hg itself, because when I redirect the output of hg help qimport to a file and open the latter in an editor I see this:

hg qimport [-e] [-n NOM] [-f] [-g] [-P] [-r REV]... FICHIER...

importe un patch

    Le patch est inséré dans la série à la suite du dernier patch appliqué.
    Si aucun patch n'a encore été appliqué, le patch sera ajouté en tête de
    série.

    Le patch portera le même nom que le fichier dont il provient, à moins
    qu'un autre nom ne soit spécifié à l'aide de -n/--name.

    Vous pouvez enregistrer un patch déjà présent dans le répertoire de
    patchs à l'aide de l'option -e/--existing.

    Avec -f/--force, un patch déjà présent du même nom sera écrasé.

Which is perfect.

Best Answer

Try "PowerShell ISE" not "PowerShell" - it understands UTF-8 and other character sets.

enter image description here


Update:

Problem

You are seeing Ú instead of é

Analysis

é is at code point 0xE9 in ISO 8859-1 Latin-1 (and several similar encodings)
Ú is at code point 0xE9 in code page 850

Therefore your application is emitting text using Latin-1 encoding. However your console is set for code page 850.

Solution

Using chcp to change the console encoding will, in conjunction with an appropriately encoded font, most likely solve the problem.


I can reproduce the problem and fix it by changing the command prompt properties to change the font from "Raster" to "Lucida Console". The Raster fonts have what Microsoft refer to as an OEM encoding.

before

after