// FILE HEADER
#include <dali-toolkit/internal/text/markup-processor.h>
-// EXTERNAL INCLUDES
-#include <climits> // for ULONG_MAX
-#include <dali/integration-api/debug.h>
-
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/character-set-conversion.h>
#include <dali-toolkit/internal/text/markup-processor-color.h>
#include <dali-toolkit/internal/text/markup-processor-font.h>
#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
-#include <dali-toolkit/internal/text/xhtml-entities.h>
-
-
namespace Dali
{
const char QUOTATION_MARK = '\'';
const char SLASH = '/';
const char BACK_SLASH = '\\';
-const char AMPERSAND = '&';
-const char HASH = '#';
-const char SEMI_COLON = ';';
-const char CHAR_ARRAY_END = '\0';
-const char HEX_CODE = 'x';
const char WHITE_SPACE = 0x20; // ASCII value of the white space.
-// Range 1 0x0u < XHTML_DECIMAL_ENTITY_RANGE <= 0xD7FFu
-// Range 2 0xE000u < XHTML_DECIMAL_ENTITY_RANGE <= 0xFFFDu
-// Range 3 0x10000u < XHTML_DECIMAL_ENTITY_RANGE <= 0x10FFFFu
-const unsigned long XHTML_DECIMAL_ENTITY_RANGE[] = { 0x0u, 0xD7FFu, 0xE000u, 0xFFFDu, 0x10000u, 0x10FFFFu };
-
const unsigned int MAX_NUM_OF_ATTRIBUTES = 5u; ///< The font tag has the 'family', 'size' 'weight', 'width' and 'slant' attrubutes.
const unsigned int DEFAULT_VECTOR_SIZE = 16u; ///< Default size of run vectors.
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_MARKUP_PROCESSOR");
-#endif
-
/**
* @brief Struct used to retrieve the style runs from the mark-up string.
*/
return isTag;
}
-/**
- * @brief Returns length of XHTML entity by parsing the text. It also determines if it is XHTML entity or not.
- *
- * @param[in] markupStringBuffer The mark-up string buffer. It's a const iterator pointing the current character.
- * @param[in] markupStringEndBuffer Pointing to end of mark-up string buffer.
- *
- * @return Length of markupText in case of XHTML entity otherwise return 0.
- */
-unsigned int GetXHTMLEntityLength( const char*& markupStringBuffer,
- const char* const markupStringEndBuffer )
-{
- char character = *markupStringBuffer;
- if( AMPERSAND == character ) // '&'
- {
- // if the iterator is pointing to a '&' character, then check for ';' to find end to XHTML entity.
- ++markupStringBuffer;
- if( markupStringBuffer < markupStringEndBuffer )
- {
- unsigned int len = 1u;
- for( ; markupStringBuffer < markupStringEndBuffer ; ++markupStringBuffer )
- {
- character = *markupStringBuffer;
- ++len;
- if( SEMI_COLON == character ) // ';'
- {
- // found end of XHTML entity
- ++markupStringBuffer;
- return len;
- }
- else if( ( AMPERSAND == character ) || ( BACK_SLASH == character ) || ( LESS_THAN == character ))
- {
- return 0;
- }
- }
- }
- }
- return 0;
-}
-
-/**
- * @brief It parses a XHTML string which has hex/decimal entity and fill its corresponging utf-8 string.
- *
- * @param[in] markupText The mark-up text buffer.
- * @param[out] utf-8 text Corresponding to markup Text
- *
- * @return true if string is successfully parsed otherwise false
- */
-bool XHTMLNumericEntityToUtf8 ( const char* markupText, char* utf8 )
-{
- bool result = false;
-
- if( NULL != markupText )
- {
- bool isHex = false;
-
- // check if hex or decimal entity
- if( ( CHAR_ARRAY_END != *markupText ) && ( HEX_CODE == *markupText ) )
- {
- isHex = true;
- ++markupText;
- }
-
- char* end = NULL;
- unsigned long l = strtoul( markupText, &end, ( isHex ? 16 : 10 ) ); // l contains UTF-32 code in case of correct XHTML entity
-
- // check for valid XHTML numeric entities (between '#' or "#x" and ';')
- if( ( l > 0 ) && ( l < ULONG_MAX ) && ( *end == SEMI_COLON ) ) // in case wrong XHTML entity is set eg. "abcdefs;" in that case *end will be 'a'
- {
- /* characters XML 1.1 permits */
- if( ( ( XHTML_DECIMAL_ENTITY_RANGE[0] < l ) && ( l <= XHTML_DECIMAL_ENTITY_RANGE[1] ) ) ||
- ( ( XHTML_DECIMAL_ENTITY_RANGE[2] <= l ) && ( l <= XHTML_DECIMAL_ENTITY_RANGE[3] ) ) ||
- ( ( XHTML_DECIMAL_ENTITY_RANGE[4] <= l ) && ( l <= XHTML_DECIMAL_ENTITY_RANGE[5] ) ) )
- {
- // Convert UTF32 code to UTF8
- Utf32ToUtf8( reinterpret_cast<const uint32_t* const>( &l ), 1, reinterpret_cast<uint8_t*>( utf8 ) );
- result = true;
- }
- }
- }
- return result;
-}
-
} // namespace
void ProcessMarkupString( const std::string& markupString, MarkupProcessData& markupProcessData )
}
} // <outline></outline>
} // end if( IsTag() )
- else if( markupStringBuffer < markupStringEndBuffer )
+ else
{
unsigned char character = *markupStringBuffer;
- const char* markupBuffer = markupStringBuffer;
- unsigned char count = GetUtf8Length( character );
- char utf8[8];
if( ( BACK_SLASH == character ) && ( markupStringBuffer + 1u < markupStringEndBuffer ) )
{
- // Adding < , > or & special character.
+ // Adding < or > special character.
const unsigned char nextCharacter = *( markupStringBuffer + 1u );
- if( ( LESS_THAN == nextCharacter ) || ( GREATER_THAN == nextCharacter ) || ( AMPERSAND == nextCharacter ) )
+ if( ( LESS_THAN == nextCharacter ) || ( GREATER_THAN == nextCharacter ) )
{
character = nextCharacter;
++markupStringBuffer;
-
- count = GetUtf8Length( character );
- markupBuffer = markupStringBuffer;
}
}
- else // checking if conatins XHTML entity or not
- {
- const unsigned int len = GetXHTMLEntityLength( markupStringBuffer, markupStringEndBuffer);
-
- // Parse markupStringTxt if it contains XHTML Entity between '&' and ';'
- if( len > 0 )
- {
- char* entityCode = NULL;
- bool result = false;
- count = 0;
- // Checking if XHTML Numeric Entity
- if( HASH == *( markupBuffer + 1u ) )
- {
- entityCode = &utf8[0];
- // markupBuffer is currently pointing to '&'. By adding 2u to markupBuffer it will point to numeric string by skipping "&#'
- result = XHTMLNumericEntityToUtf8( ( markupBuffer + 2u ), entityCode );
- }
- else // Checking if XHTML Named Entity
- {
- entityCode = const_cast<char*> ( NamedEntityToUtf8( markupBuffer, len ) );
- result = ( entityCode != NULL );
- }
- if ( result )
- {
- markupBuffer = entityCode; //utf8 text assigned to markupBuffer
- character = markupBuffer[0];
- }
- else
- {
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Not valid XHTML entity : (%.*s) \n", len, markupBuffer );
- markupBuffer = NULL;
- }
- }
- else // in case string conatins Start of XHTML Entity('&') but not its end character(';')
- {
- if( character == AMPERSAND )
- {
- markupBuffer = NULL;
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Not Well formed XHTML content \n" );
- }
- }
- }
+ const unsigned char numberOfBytes = GetUtf8Length( character );
- if( markupBuffer != NULL )
+ markupProcessData.markupProcessedText.push_back( character );
+ for( unsigned char i = 1u; i < numberOfBytes; ++i )
{
- const unsigned char numberOfBytes = GetUtf8Length( character );
- markupProcessData.markupProcessedText.push_back( character );
-
- for( unsigned char i = 1u; i < numberOfBytes; ++i )
- {
- ++markupBuffer;
- markupProcessData.markupProcessedText.push_back( *markupBuffer );
- }
-
- ++characterIndex;
- markupStringBuffer += count;
+ ++markupStringBuffer;
+ markupProcessData.markupProcessedText.push_back( *markupStringBuffer );
}
+
+ ++characterIndex;
+ ++markupStringBuffer;
}
}
+++ /dev/null
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <cstring> // for strlen()
-
-// FILE HEADER
-#include "xhtml-entities.h"
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Text
-{
-
-namespace
-{
-/**
- * Implementation of the XHTML Entity matching
- */
-struct XHTMLEntityLookup
-{
- const char* const entityName; // XHTML Named Entity string
- const char* const entityCode; // Corresponding UTF-8
-};
-
-/* table of html name entities supported in DALi
- *
- * these are stored as pair with Named entity as Key and
- * its utf 8 as value
- */
-const XHTMLEntityLookup XHTMLEntityLookupTable[] =
- {
- { ""\0" ,"\x22\0" },
- { "&\0" ,"\x26\0" },
- { "'\0" ,"\x27\0" },
- { "<\0" ,"\x3c\0" },
- { ">\0" ,"\x3e\0" },
- { " \0" ,"\xc2\xa0\0" },
- { "¡\0" ,"\xc2\xa1\0" },
- { "¢\0" ,"\xc2\xa2\0" },
- { "£\0" ,"\xc2\xa3\0" },
- { "¤\0" ,"\xc2\xa4\0" },
- { "¥\0" ,"\xc2\xa5\0" },
- { "¦\0" ,"\xc2\xa6\0" },
- { "§\0" ,"\xc2\xa7\0" },
- { "¨\0" ,"\xc2\xa8\0" },
- { "©\0" ,"\xc2\xa9\0" },
- { "ª\0" ,"\xc2\xaa\0" },
- { "«\0" ,"\xc2\xab\0" },
- { "¬\0" ,"\xc2\xac\0" },
- { "­\0" ,"\xc2\xad\0" },
- { "®\0" ,"\xc2\xae\0" },
- { "¯\0" ,"\xc2\xaf\0" },
- { "°\0" ,"\xc2\xb0\0" },
- { "±\0" ,"\xc2\xb1\0" },
- { "²\0" ,"\xc2\xb2\0" },
- { "³\0" ,"\xc2\xb3\0" },
- { "´\0" ,"\xc2\xb4\0" },
- { "µ\0" ,"\xc2\xb5\0" },
- { "¶\0" ,"\xc2\xb6\0" },
- { "·\0" ,"\xc2\xb7\0" },
- { "¸\0" ,"\xc2\xb8\0" },
- { "¹\0" ,"\xc2\xb9\0" },
- { "º\0" ,"\xc2\xba\0" },
- { "»\0" ,"\xc2\xbb\0" },
- { "¼\0" ,"\xc2\xbc\0" },
- { "½\0" ,"\xc2\xbd\0" },
- { "¾\0" ,"\xc2\xbe\0" },
- { "¿\0" ,"\xc2\xbf\0" },
- { "À\0" ,"\xc3\x80\0" },
- { "Á\0" ,"\xc3\x81\0" },
- { "Â\0" ,"\xc3\x82\0" },
- { "Ã\0" ,"\xc3\x83\0" },
- { "Ä\0" ,"\xc3\x84\0" },
- { "Å\0" ,"\xc3\x85\0" },
- { "Æ\0" ,"\xc3\x86\0" },
- { "Ç\0" ,"\xc3\x87\0" },
- { "È\0" ,"\xc3\x88\0" },
- { "É\0" ,"\xc3\x89\0" },
- { "Ê\0" ,"\xc3\x8a\0" },
- { "Ë\0" ,"\xc3\x8b\0" },
- { "Ì\0" ,"\xc3\x8c\0" },
- { "Í\0" ,"\xc3\x8d\0" },
- { "Î\0" ,"\xc3\x8e\0" },
- { "Ï\0" ,"\xc3\x8f\0" },
- { "Ð\0" ,"\xc3\x90\0" },
- { "Ñ\0" ,"\xc3\x91\0" },
- { "Ò\0" ,"\xc3\x92\0" },
- { "Ó\0" ,"\xc3\x93\0" },
- { "Ô\0" ,"\xc3\x94\0" },
- { "Õ\0" ,"\xc3\x95\0" },
- { "Ö\0" ,"\xc3\x96\0" },
- { "×\0" ,"\xc3\x97\0" },
- { "Ø\0" ,"\xc3\x98\0" },
- { "Ù\0" ,"\xc3\x99\0" },
- { "Ú\0" ,"\xc3\x9a\0" },
- { "Û\0" ,"\xc3\x9b\0" },
- { "Ü\0" ,"\xc3\x9c\0" },
- { "Ý\0" ,"\xc3\x9d\0" },
- { "Þ\0" ,"\xc3\x9e\0" },
- { "ß\0" ,"\xc3\x9f\0" },
- { "à\0" ,"\xc3\xa0\0" },
- { "á\0" ,"\xc3\xa1\0" },
- { "â\0" ,"\xc3\xa2\0" },
- { "ã\0" ,"\xc3\xa3\0" },
- { "ä\0" ,"\xc3\xa4\0" },
- { "å\0" ,"\xc3\xa5\0" },
- { "æ\0" ,"\xc3\xa6\0" },
- { "ç\0" ,"\xc3\xa7\0" },
- { "è\0" ,"\xc3\xa8\0" },
- { "é\0" ,"\xc3\xa9\0" },
- { "ê\0" ,"\xc3\xaa\0" },
- { "ë\0" ,"\xc3\xab\0" },
- { "ì\0" ,"\xc3\xac\0" },
- { "í\0" ,"\xc3\xad\0" },
- { "î\0" ,"\xc3\xae\0" },
- { "ï\0" ,"\xc3\xaf\0" },
- { "ð\0" ,"\xc3\xb0\0" },
- { "ñ\0" ,"\xc3\xb1\0" },
- { "ò\0" ,"\xc3\xb2\0" },
- { "ó\0" ,"\xc3\xb3\0" },
- { "ô\0" ,"\xc3\xb4\0" },
- { "õ\0" ,"\xc3\xb5\0" },
- { "ö\0" ,"\xc3\xb6\0" },
- { "÷\0" ,"\xc3\xb7\0" },
- { "ø\0" ,"\xc3\xb8\0" },
- { "ù\0" ,"\xc3\xb9\0" },
- { "ú\0" ,"\xc3\xba\0" },
- { "û\0" ,"\xc3\xbb\0" },
- { "ü\0" ,"\xc3\xbc\0" },
- { "ý\0" ,"\xc3\xbd\0" },
- { "þ\0" ,"\xc3\xbe\0" },
- { "ÿ\0" ,"\xc3\xbf\0" },
- { "Œ\0" ,"\xc5\x92\0" },
- { "œ\0" ,"\xc5\x93\0" },
- { "Š\0" ,"\xc5\xa0\0" },
- { "š\0" ,"\xc5\xa1\0" },
- { "Ÿ\0" ,"\xc5\xb8\0" },
- { "ƒ\0" ,"\xc6\x92\0" },
- { "ˆ\0" ,"\xcb\x86\0" },
- { "˜\0" ,"\xcb\x9c\0" },
- { "Α\0" ,"\xce\x91\0" },
- { "Β\0" ,"\xce\x92\0" },
- { "Γ\0" ,"\xce\x93\0" },
- { "Δ\0" ,"\xce\x94\0" },
- { "Ε\0" ,"\xce\x95\0" },
- { "Ζ\0" ,"\xce\x96\0" },
- { "Η\0" ,"\xce\x97\0" },
- { "Θ\0" ,"\xce\x98\0" },
- { "Ι\0" ,"\xce\x99\0" },
- { "Κ\0" ,"\xce\x9a\0" },
- { "Λ\0" ,"\xce\x9b\0" },
- { "Μ\0" ,"\xce\x9c\0" },
- { "Ν\0" ,"\xce\x9d\0" },
- { "Ξ\0" ,"\xce\x9e\0" },
- { "Ο\0" ,"\xce\x9f\0" },
- { "Π\0" ,"\xce\xa0\0" },
- { "Ρ\0" ,"\xce\xa1\0" },
- { "Σ\0" ,"\xce\xa3\0" },
- { "Τ\0" ,"\xce\xa4\0" },
- { "Υ\0" ,"\xce\xa5\0" },
- { "Φ\0" ,"\xce\xa6\0" },
- { "Χ\0" ,"\xce\xa7\0" },
- { "Ψ\0" ,"\xce\xa8\0" },
- { "Ω\0" ,"\xce\xa9\0" },
- { "α\0" ,"\xce\xb1\0" },
- { "β\0" ,"\xce\xb2\0" },
- { "γ\0" ,"\xce\xb3\0" },
- { "δ\0" ,"\xce\xb4\0" },
- { "ε\0" ,"\xce\xb5\0" },
- { "ζ\0" ,"\xce\xb6\0" },
- { "η\0" ,"\xce\xb7\0" },
- { "θ\0" ,"\xce\xb8\0" },
- { "ι\0" ,"\xce\xb9\0" },
- { "κ\0" ,"\xce\xba\0" },
- { "λ\0" ,"\xce\xbb\0" },
- { "μ\0" ,"\xce\xbc\0" },
- { "ν\0" ,"\xce\xbd\0" },
- { "ξ\0" ,"\xce\xbe\0" },
- { "ο\0" ,"\xce\xbf\0" },
- { "π\0" ,"\xcf\x80\0" },
- { "ρ\0" ,"\xcf\x81\0" },
- { "ς\0" ,"\xcf\x82\0" },
- { "σ\0" ,"\xcf\x83\0" },
- { "τ\0" ,"\xcf\x84\0" },
- { "υ\0" ,"\xcf\x85\0" },
- { "φ\0" ,"\xcf\x86\0" },
- { "χ\0" ,"\xcf\x87\0" },
- { "ψ\0" ,"\xcf\x88\0" },
- { "ω\0" ,"\xcf\x89\0" },
- { "ϑ\0","\xcf\x91\0" },
- { "ϒ\0" ,"\xcf\x92\0" },
- { "ϖ\0" ,"\xcf\x96\0" },
- { " \0" ,"\xe2\x80\x82\0" },
- { " \0" ,"\xe2\x80\x83\0" },
- { " \0" ,"\xe2\x80\x89\0" },
- { "‌\0" ,"\xe2\x80\x8c\0" },
- { "‍\0" ,"\xe2\x80\x8d\0" },
- { "‎\0" ,"\xe2\x80\x8e\0" },
- { "‏\0" ,"\xe2\x80\x8f\0" },
- { "–\0" ,"\xe2\x80\x93\0" },
- { "—\0" ,"\xe2\x80\x94\0" },
- { "‘\0" ,"\xe2\x80\x98\0" },
- { "’\0" ,"\xe2\x80\x99\0" },
- { "‚\0" ,"\xe2\x80\x9a\0" },
- { "“\0" ,"\xe2\x80\x9c\0" },
- { "”\0" ,"\xe2\x80\x9d\0" },
- { "„\0" ,"\xe2\x80\x9e\0" },
- { "†\0" ,"\xe2\x80\xa0\0" },
- { "‡\0" ,"\xe2\x80\xa1\0" },
- { "•\0" ,"\xe2\x80\xa2\0" },
- { "…\0" ,"\xe2\x80\xa6\0" },
- { "‰\0" ,"\xe2\x80\xb0\0" },
- { "′\0" ,"\xe2\x80\xb2\0" },
- { "″\0" ,"\xe2\x80\xb3\0" },
- { "‹\0" ,"\xe2\x80\xb9\0" },
- { "›\0" ,"\xe2\x80\xba\0" },
- { "‾\0" ,"\xe2\x80\xbe\0" },
- { "⁄\0" ,"\xe2\x81\x84\0" },
- { "€\0" ,"\xe2\x82\xac\0" },
- { "ℑ\0" ,"\xe2\x84\x91\0" },
- { "℘\0" ,"\xe2\x84\x98\0" },
- { "ℜ\0" ,"\xe2\x84\x9c\0" },
- { "™\0" ,"\xe2\x84\xa2\0" },
- { "ℵ\0" ,"\xe2\x84\xb5\0" },
- { "←\0" ,"\xe2\x86\x90\0" },
- { "↑\0" ,"\xe2\x86\x91\0" },
- { "→\0" ,"\xe2\x86\x92\0" },
- { "↓\0" ,"\xe2\x86\x93\0" },
- { "↔\0" ,"\xe2\x86\x94\0" },
- { "↵\0" ,"\xe2\x86\xb5\0" },
- { "⇐\0" ,"\xe2\x87\x90\0" },
- { "⇑\0" ,"\xe2\x87\x91\0" },
- { "⇒\0" ,"\xe2\x87\x92\0" },
- { "⇓\0" ,"\xe2\x87\x93\0" },
- { "⇔\0" ,"\xe2\x87\x94\0" },
- { "∀\0" ,"\xe2\x88\x80\0" },
- { "∂\0" ,"\xe2\x88\x82\0" },
- { "∃\0" ,"\xe2\x88\x83\0" },
- { "∅\0" ,"\xe2\x88\x85\0" },
- { "∇\0" ,"\xe2\x88\x87\0" },
- { "∈\0" ,"\xe2\x88\x88\0" },
- { "∉\0" ,"\xe2\x88\x89\0" },
- { "∋\0" ,"\xe2\x88\x8b\0" },
- { "∏\0" ,"\xe2\x88\x8f\0" },
- { "∑\0" ,"\xe2\x88\x91\0" },
- { "−\0" ,"\xe2\x88\x92\0" },
- { "∗\0" ,"\xe2\x88\x97\0" },
- { "√\0" ,"\xe2\x88\x9a\0" },
- { "∝\0" ,"\xe2\x88\x9d\0" },
- { "∞\0" ,"\xe2\x88\x9e\0" },
- { "∠\0" ,"\xe2\x88\xa0\0" },
- { "∧\0" ,"\xe2\x88\xa7\0" },
- { "∨\0" ,"\xe2\x88\xa8\0" },
- { "∩\0" ,"\xe2\x88\xa9\0" },
- { "∪\0" ,"\xe2\x88\xaa\0" },
- { "∫\0" ,"\xe2\x88\xab\0" },
- { "∴\0" ,"\xe2\x88\xb4\0" },
- { "∼\0" ,"\xe2\x88\xbc\0" },
- { "≅\0" ,"\xe2\x89\x85\0" },
- { "≈\0" ,"\xe2\x89\x88\0" },
- { "≠\0" ,"\xe2\x89\xa0\0" },
- { "≡\0" ,"\xe2\x89\xa1\0" },
- { "≤\0" ,"\xe2\x89\xa4\0" },
- { "≥\0" ,"\xe2\x89\xa5\0" },
- { "⊂\0" ,"\xe2\x8a\x82\0" },
- { "⊃\0" ,"\xe2\x8a\x83\0" },
- { "⊄\0" ,"\xe2\x8a\x84\0" },
- { "⊆\0" ,"\xe2\x8a\x86\0" },
- { "⊇\0" ,"\xe2\x8a\x87\0" },
- { "⊕\0" ,"\xe2\x8a\x95\0" },
- { "⊗\0" ,"\xe2\x8a\x97\0" },
- { "⊥\0" ,"\xe2\x8a\xa5\0" },
- { "⋅\0" ,"\xe2\x8b\x85\0" },
- { "⌈\0" ,"\xe2\x8c\x88\0" },
- { "⌉\0" ,"\xe2\x8c\x89\0" },
- { "⌊\0" ,"\xe2\x8c\x8a\0" },
- { "⌋\0" ,"\xe2\x8c\x8b\0" },
- { "◊\0" ,"\xe2\x97\x8a\0" },
- { "♠\0" ,"\xe2\x99\xa0\0" },
- { "♣\0" ,"\xe2\x99\xa3\0" },
- { "♥\0" ,"\xe2\x99\xa5\0" },
- { "♦\0" ,"\xe2\x99\xa6\0" },
- { "⟨\0" ,"\xe2\x9f\xa8\0" },
- { "⟩\0" ,"\xe2\x9f\xa9\0" }
-};
-
-const std::size_t XHTMLENTITY_LOOKUP_COUNT = (sizeof( XHTMLEntityLookupTable))/ (sizeof(XHTMLEntityLookup));
-
-} // unnamed namespace
-
-const char* const NamedEntityToUtf8( const char* const markupText, unsigned int len )
-{
- // finding if given XHTML named entity is supported or not
- for( size_t i = 0; i < XHTMLENTITY_LOOKUP_COUNT ; ++i )
- {
- unsigned int entityLen = strlen(XHTMLEntityLookupTable[i].entityName);
- if( len == entityLen )
- {
- if( strncmp( markupText, XHTMLEntityLookupTable[i].entityName, len ) == 0 ) // if named Entity found in table
- {
- return XHTMLEntityLookupTable[i].entityCode;
- }
- }
- }
- return NULL;
-}
-
-} // namespace Text
-
-} // namespace Toolkit
-
-} // namespace Dali