KVIrc 5.2.6
Developer APIs
KviLocale.cpp File Reference
#include "kvi_debug.h"
#include "kvi_defaults.h"
#include "KviMemory.h"
#include "KviByteOrder.h"
#include "KviLocale.h"
#include "KviCString.h"
#include "KviQString.h"
#include "KviEnvironment.h"
#include "KviFileUtils.h"
#include "KviFile.h"
#include "KviPointerHashTable.h"
#include "KviTranslator.h"
#include <QApplication>
#include <QByteArray>
#include <QDir>
#include <QLocale>
#include <QString>
#include <QTextCodec>
#include <QtGlobal>

Classes

class  KviSmartTextCodec
 

Macros

#define _KVI_LOCALE_CPP_
 
#define CONTINUATION_CHAR
 
#define UNICODE_VALID(Char)
 

Functions

static const char * fast_validate (const char *str)
 
static const char * fast_validate_len (const char *str, int max_len)
 
static bool g_utf8_validate (const char *str, int max_len, const char **end)
 

Variables

static const char * encoding_groups []
 
static KviPointerHashTable< const char *, KviMessageCatalogue > * g_pCatalogueDict = nullptr
 
KVILIB_API KviMessageCatalogueg_pMainCatalogue = nullptr
 
static KviPointerHashTable< const char *, KviSmartTextCodec > * g_pSmartCodecDict = nullptr
 
static KviTranslatorg_pTranslator = nullptr
 
static QTextCodec * g_pUtf8TextCodec = nullptr
 
static QString g_szDefaultLocalePath
 
static KviLocale::EncodingDescription supported_encodings []
 

Macro Definition Documentation

◆ _KVI_LOCALE_CPP_

#define _KVI_LOCALE_CPP_

◆ CONTINUATION_CHAR

#define CONTINUATION_CHAR
Value:
if((*(unsigned char *)p & 0xc0) != 0x80) /* 10xxxxxx */ \
goto error; \
val <<= 6; \
val |= (*(unsigned char *)p) & 0x3f;
#define p
Definition detector.cpp:81

Referenced by fast_validate(), and fast_validate_len().

◆ UNICODE_VALID

#define UNICODE_VALID ( Char)
Value:
((Char) < 0x110000 && (((Char)&0xFFFFF800) != 0xD800) && ((Char) < 0xFDD0 || (Char) > 0xFDEF) && ((Char)&0xFFFE) != 0xFFFE)

Referenced by fast_validate(), and fast_validate_len().

Function Documentation

◆ fast_validate()

static const char * fast_validate ( const char * str)
static

References CONTINUATION_CHAR, p, and UNICODE_VALID.

Referenced by g_utf8_validate().

◆ fast_validate_len()

static const char * fast_validate_len ( const char * str,
int max_len )
static

References CONTINUATION_CHAR, p, and UNICODE_VALID.

Referenced by g_utf8_validate().

◆ g_utf8_validate()

static bool g_utf8_validate ( const char * str,
int max_len,
const char ** end )
static

Variable Documentation

◆ encoding_groups

const char* encoding_groups[]
static
Initial value:
= {
"Unicode",
"West European",
"East European",
"Cyrillic",
"Middle Eastern",
"Chinese",
"Japanese",
"Other Asiatic",
nullptr
}

Referenced by KviLocale::encodingGroup().

◆ g_pCatalogueDict

◆ g_pMainCatalogue

◆ g_pSmartCodecDict

◆ g_pTranslator

KviTranslator* g_pTranslator = nullptr
static

◆ g_pUtf8TextCodec

◆ g_szDefaultLocalePath

QString g_szDefaultLocalePath
static

◆ supported_encodings

KviLocale::EncodingDescription supported_encodings[]
static