latest changes from main repository

This commit is contained in:
Guenter Obiltschnig
2007-04-25 08:39:02 +00:00
parent f29f7cda53
commit 3e46ab332b
60 changed files with 1619 additions and 163 deletions

View File

@@ -1,13 +1,13 @@
//
// UTF8Encoding.cpp
//
// $Id: //poco/Main/Foundation/src/UTF8Encoding.cpp#12 $
// $Id: //poco/Main/Foundation/src/UTF8Encoding.cpp#13 $
//
// Library: Foundation
// Package: Text
// Module: UTF8Encoding
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
@@ -35,11 +35,20 @@
#include "Poco/UTF8Encoding.h"
#include "Poco/String.h"
namespace Poco {
const char* UTF8Encoding::_names[] =
{
"UTF-8",
"UTF8",
NULL
};
const TextEncoding::CharacterMap UTF8Encoding::_charMap =
{
/* 00 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
@@ -71,6 +80,23 @@ UTF8Encoding::~UTF8Encoding()
}
const char* UTF8Encoding::canonicalName() const
{
return _names[0];
}
bool UTF8Encoding::isA(const std::string& encodingName) const
{
for (const char** name = _names; *name; ++name)
{
if (Poco::icompare(encodingName, *name) == 0)
return true;
}
return false;
}
const TextEncoding::CharacterMap& UTF8Encoding::characterMap() const
{
return _charMap;