annotate README @ 9424:799373ff2554

highlight: fixes garbled text in non-UTF-8 environment This patch treats all files inside repository as encoded by locale's encoding when pygmentize. We can assume that most files are written in locale's encoding, but current implementation treats them as UTF-8. So there's no way to specify the encoding of files. Current implementation, db7557359636 (issue1341): 1. Convert original `text`, which is treated as UTF-8, to locale's encoding. `encoding.tolocal()` is the method to convert from internal UTF-8 to local. If original `text` is not UTF-8, e.g. Japanese EUC-JP, some characters become garbled here. 2. pygmentize, with no UnicodeDecodeError. This patch: 1. Convert original `text`, which is treated as locale's encoding, to unicode. Pygments prefers unicode object than raw str. [1]_ If original `text` is not encoded by locale's encoding, some characters become garbled here. 2. pygmentize, also with no UnicodeDecodeError :) 3. Convert unicode back to raw str, which is encoded by locale's. .. [1] http://pygments.org/docs/unicode/
author Yuya Nishihara <yuya@tcha.org>
date Sat, 29 Aug 2009 15:24:15 +0900
parents 1de6e7e1bb9f
children 6219401643d1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3935
1158d7018052 Move README info to wiki
Matt Mackall <mpm@selenic.com>
parents: 3847
diff changeset
1 Basic install:
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
2
3935
1158d7018052 Move README info to wiki
Matt Mackall <mpm@selenic.com>
parents: 3847
diff changeset
3 $ make # see install targets
1158d7018052 Move README info to wiki
Matt Mackall <mpm@selenic.com>
parents: 3847
diff changeset
4 $ make install # do a system-wide install
1158d7018052 Move README info to wiki
Matt Mackall <mpm@selenic.com>
parents: 3847
diff changeset
5 $ hg debuginstall # sanity-check setup
1158d7018052 Move README info to wiki
Matt Mackall <mpm@selenic.com>
parents: 3847
diff changeset
6 $ hg # see help
205
d255d99a7cbd README: integrate some changes from Kevin Smith
mpm@selenic.com
parents: 204
diff changeset
7
8936
1de6e7e1bb9f change wiki/bts URLs to point to new hostname
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 3935
diff changeset
8 See http://mercurial.selenic.com/ for detailed installation
3935
1158d7018052 Move README info to wiki
Matt Mackall <mpm@selenic.com>
parents: 3847
diff changeset
9 instructions, platform-specific notes, and Mercurial user information.
327
a9ad98a9c9bc Tweak README for branch, push, and .hgrc
mpm@selenic.com
parents: 261
diff changeset
10