transaction abort!rollback completed
abort: unknown encoding: x-windows-949, please check your locale settings. ...
OS - Microsoft Windows 7 and XP, Korean
Eclipse - 3.5.1 (default encoding for windows version = MS949)
MercurialEclipse - 1.6.0 (also 1.7.0)
* Problem
Cannot commit, push, synchronize, ... after error message "transaction abort!rollback completed"
* Cause
MercurilEclipse calls 'hg.exe' with arguments like this ...
hg.exe --config ui.fallbackencoding=windows-1251 --encoding x-windows-949 ...
'x-windows-949' is not a name that hg.exe, also python, can recognize and 'unknown encoding' error occurs.
Python support 'MS949' encoding.
** Cause
in 'src/com/vectrace/MercurialEclipse/team/MercurialTeamProvider.java'
protected IStatus run(IProgressMonitor monitor) {
if (HgDebugInstallClient.hgSupportsEncoding(defaultCharset)) {
hgRoot.setEncoding(''Charset.forName(defaultCharset)'');
}
monitor.done();
return Status.OK_STATUS;
}
in 'src/com/vectrace/MercurialEclipse/commands/AbstractShellCommand.java'
private Charset setupEncoding(List<String> cmd) {
if(hgRoot == null){
return null;
}
Charset charset = hgRoot.getEncoding();
// Enforce strict command line encoding
cmd.add(1, ''charset.name()'');
cmd.add(1, "--encoding");
// Enforce fallback encoding for UI (command output)
// Note: base encoding is UTF-8 for mercurial, fallback is only take into account
// if actual platfrom don't support it.
cmd.add(1, "ui.fallbackencoding=" + hgRoot.getFallbackencoding().name()); //$NON-NLS-1$
cmd.add(1, "--config"); //$NON-NLS-1$
return charset;
}
'defaultCharset' contains eclipse's default text file encoding (which can be set in preference-General-Workspace).
This variable is set to 'MS949' in Korean version Windows.
However, 'MS949' is changed to 'x-windows-949' by codes 'Charset.forName("MS949")' and 'charset.name()'.