2006-11-22 23:01:37 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Artem Pavlenko
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
//$Id$
|
|
|
|
#ifndef UNICODE_HPP
|
|
|
|
#define UNICODE_HPP
|
|
|
|
|
2009-02-12 15:33:00 +01:00
|
|
|
//mapnik
|
|
|
|
#include <mapnik/config.hpp>
|
2009-02-11 18:09:56 +01:00
|
|
|
// icu
|
2008-02-18 22:40:34 +01:00
|
|
|
#include <unicode/unistr.h>
|
|
|
|
#include <unicode/ucnv.h>
|
2009-02-11 18:09:56 +01:00
|
|
|
// boost
|
2008-01-03 12:41:00 +01:00
|
|
|
#include <boost/utility.hpp>
|
2009-02-11 18:09:56 +01:00
|
|
|
// stl
|
|
|
|
#include <string>
|
2007-10-11 23:18:04 +02:00
|
|
|
|
2006-11-22 23:01:37 +01:00
|
|
|
namespace mapnik {
|
2009-02-12 15:33:00 +01:00
|
|
|
class MAPNIK_DECL transcoder : private boost::noncopyable
|
2007-02-06 15:27:21 +01:00
|
|
|
{
|
|
|
|
public:
|
2008-01-03 12:41:00 +01:00
|
|
|
explicit transcoder (std::string const& encoding);
|
2008-02-18 22:40:34 +01:00
|
|
|
UnicodeString transcode(const char* data) const;
|
2008-01-03 12:41:00 +01:00
|
|
|
~transcoder();
|
|
|
|
private:
|
2008-02-18 22:40:34 +01:00
|
|
|
bool ok_;
|
|
|
|
UConverter * conv_;
|
2007-02-06 15:27:21 +01:00
|
|
|
};
|
2006-11-22 23:01:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // UNICODE_HPP
|