Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
thg
thg
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 799
    • Issues 799
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • mercurial
  • TortoiseHg
  • thgthg
  • Wiki
    • Developers
  • EncodingStrategy

Last edited by Yuya Nishihara Feb 14, 2015
Page history

EncodingStrategy

Encoding Strategy

Overview

  • All Mercurial inputs and outputs are in local encoding, except for
    • file contents, which are in arbitrary encoding or binary
    • -Tjson output may be encoded in UTF-8b
  • All QStrings are in unicode
  • All strings passed to Qt are converted to a QString (in API 1)
  • All strings returned by Qt APIs are QString (in API 1)
  • All strings emitted through signals are converted to QString (in API 1)
  • Our gettext wrapper _() returns unicode strings
  • Configuration files are assumed to be in local encoding by Mercurial

API

  • hglib.tounicode() converts local string to unicode (Mercurial to Qt)
  • hglib.fromunicode() converts unicode or QString to local string (Qt to Mercurial)
  • Built-in unicode() can be used to convert QString to unicode
  • fileencoding.guessencoding() can be used to select possible encoding for file

Known issues

command:

TODO

file content:

  • #3596 - Missing handling of content encoding in FileDiffDialog
  • #3715 - MQ: Edit patch reject: "Could not translate the file content from native encoding."

See also

  • http://mercurial.selenic.com/wiki/EncodingStrategy
  • http://mercurial.selenic.com/wiki/GenericTemplatingPlan
  • http://pyqt.sourceforge.net/Docs/PyQt4/incompatible_apis.html
Clone repository
  • BugReport
  • CentOS
  • FixedBugs
  • Home
  • KeySequences
  • Nit
  • OldNews
  • OlderReleaseNotes
  • OpenAtLine
  • ReleaseNotes
  • RoadMap
  • SVN HG
  • SVN
  • Ubuntu
  • developers
    • CommonSignals
View All Pages