Issue #2475 resolved

Crash when replacing untranslatable characters

Josip Medved
created an issue

I tried to do commit with message 'Added čc.'. I got message: Unable to translate message to local encoding Consider setting HGENCODING environment variable Replace untranslatable characters with "?"?

I answered 'Replace' and TortoiseHg crashed.

Stack trace:

** Mercurial version (2.4.2+20130203).  TortoiseHg version (2.7)
** Command: --nofork commit
** CWD: Q:\Projects\Outsource\Cras\Rampa
** Encoding: cp1252
** Extensions loaded: convert, mercurial_keyring
** Python version: 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
** Windows version: sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack='')
** Processor architecture: x64
** Qt-4.8.4 PyQt-4.9.6 QScintilla-2.7
Traceback (most recent call last):
  File "tortoisehg\hgqt\commit.pyo", line 464, in mqPerformAction
  File "tortoisehg\hgqt\commit.pyo", line 790, in commit
  File "tortoisehg\hgqt\messageentry.pyo", line 54, in setText
  File "tortoisehg\hgqt\qscilib.pyo", line 378, in setDefaultEolMode
  File "tortoisehg\util\hglib.pyo", line 70, in fromunicode
  File "encodings\cp1252.pyo", line 12, in encode
UnicodeEncodeError: 'charmap' codec can't encode character u'\u010d' in position 12: character maps to <undefined>