monotone

monotone Mtn Source Tree

Root/src/charset.hh

1// Copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
2//
3// This program is made available under the GNU GPL version 2.0 or
4// greater. See the accompanying file COPYING for details.
5//
6// This program is distributed WITHOUT ANY WARRANTY; without even the
7// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8// PURPOSE.
9
10#ifndef __CHARSET_HH__
11#define __CHARSET_HH__
12
13#include "vocab.hh"
14
15// Charset conversions.
16
17void charset_convert(std::string const & src_charset,
18 std::string const & dst_charset,
19 std::string const & src,
20 std::string & dst,
21 bool best_effort,
22 origin::type whence);
23void system_to_utf8(external const & system, utf8 & utf);
24void utf8_to_system_strict(utf8 const & utf, external & system);
25void utf8_to_system_strict(utf8 const & utf, std::string & system);
26void utf8_to_system_best_effort(utf8 const & utf, external & system);
27void utf8_to_system_best_effort(utf8 const & utf, std::string & system);
28bool utf8_validate(utf8 const & utf);
29
30// These are exposed for unit testing only.
31void ace_to_utf8(std::string const & a, utf8 & utf, origin::type whence);
32void utf8_to_ace(utf8 const & utf, std::string & a);
33
34
35// Returns length in characters (not bytes).
36// Is not aware of combining and invisible characters.
37size_t display_width(utf8 const & utf);
38
39#endif
40
41// Local Variables:
42// mode: C++
43// fill-column: 76
44// c-file-style: "gnu"
45// indent-tabs-mode: nil
46// End:
47// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status