Re: [viewvc-users] Charset Question
"C. Michael Pilato" <[email protected]>
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.user |
|---|---|
| Organization | CollabNet, Inc. |
| Message-ID | <[email protected]> |
José A. Berutti wrote:
> Hi
>
> My name is Jose Antonio and I'm from Brazil.
> I'd like to know if viewvc can work with ISO-8859-1 charset.
>
> By default is UTF-8, right?
> How can I change this?
To say that ViewVC is a UTF-8 application betrays reality at various points.
ViewVC's core code generates UTF-8 strings. ViewVC's default templates are
written in UTF-8. But since ViewVC's whole job is to display data from your
version controlled repositories, it winds up handling data in countless
other character sets and encodings. Since CVS is going the way of the
dinosaur, and more folks are using ViewVC to display Subversion
repositories, and since Subversion's repository metadata is all UTF-8,
ViewVC claims UTF-8 as its output character set. But this falls through
sometimes:
* CVS is character set/encoding ignorant -- no guarantees of metadata
being in any particular format.
* File contents (in both CVS and Subversion) can be in any character set/
encoding.
Until recently, ViewVC had absolutely no logic for trying to convert data
from non-UTF-8 into UTF-8 for merge into its UTF-8 output stream. ViewVC
1.1.2 (which is not yet released) will, however, attempt to detect the
character encoding of versioned files and transcode into UTF-8 if you have
the syntax coloration feature enabled. The results won't be perfect or
universal, though (for example, the "diff view" won't do character
transcoding of this sort).
There are only a few of places in ViewVC where the UTF-8 character set is
dictated.
lib/sapi.py (various functions have "charset=UTF-8" as part of the
default values for HTTP headers)
lib/viewvc.py (get_itemprops(), markup_stream_pygments())
If you know that all your data is iso-8859-1, you could examine those code
points and see if changing them to use iso-8859-1 will benefit you better.
--
C. Michael Pilato <[email protected]>
CollabNet <> www.collab.net <> Distributed Development On Demand
------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=2382443
To unsubscribe from this discussion, e-mail: [[email protected]].
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkqBXwoACgkQokEGqRcG/W4/IQCcCHwvSWt8wgpn0o4nHqfp0Jur 87kAoLzGbPSAiCY79TwWKHDZYFxMh446 =cbWv -----END PGP SIGNATURE-----