Subversion Repositories tpanel

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 21
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2020 by Andreas Theofilu <andreas@theosys.at>
2
 * Copyright (C) 2020, 2021 by Andreas Theofilu <andreas@theosys.at>
3
 *
3
 *
4
 * This program is free software; you can redistribute it and/or modify
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
7
 * (at your option) any later version.
Line 17... Line 17...
17
 */
17
 */
18
 
18
 
19
#ifndef __TNAMEFORMAT_H__
19
#ifndef __TNAMEFORMAT_H__
20
#define __TNAMEFORMAT_H__
20
#define __TNAMEFORMAT_H__
21
 
21
 
-
 
22
/** @file tnameformat.h
-
 
23
 * @brief Defines functions, classes and methods to convert strings from and
-
 
24
 * to different character sets. Mostly between the proprietary Windows
-
 
25
 * character set CP1250 and UTF-8.
-
 
26
 */
22
#include <string>
27
#include <string>
23
#include "terror.h"
28
#include "terror.h"
24
 
29
 
-
 
30
/**
-
 
31
 * @struct CHTABLE
-
 
32
 * Defines the characters to co convert between CP1250 and UTF-8 character set.
-
 
33
 */
25
typedef struct
34
typedef struct
26
{
35
{
27
	unsigned char ch;
36
    unsigned char ch;   //!< CP1250 character
28
	short byte;
37
    short byte;         //!< UTF-8 byte sequence
29
}CHTABLE;
38
}CHTABLE;
30
 
39
 
-
 
40
/**
-
 
41
 * Character set conversion table.
-
 
42
 */
31
static CHTABLE __cht[] = {
43
static CHTABLE __cht[] = {
32
	{0x80,	0x20AC},
44
	{0x80,	0x20AC},
33
	{0x81,	0x0081},
45
	{0x81,	0x0081},
34
	{0x82,	0x201A},
46
	{0x82,	0x201A},
35
	{0x83,	0x0192},
47
	{0x83,	0x0192},
Line 157... Line 169...
157
	{0xFD,	0x00FD},
169
	{0xFD,	0x00FD},
158
	{0xFE,	0x00FE},
170
	{0xFE,	0x00FE},
159
	{0xFF,	0x00FF}
171
	{0xFF,	0x00FF}
160
};
172
};
161
 
173
 
-
 
174
/**
-
 
175
 * @brief The TNameFormat class
-
 
176
 * Defines some static methods to convert character sets and some other
-
 
177
 * methods.
-
 
178
 */
162
class TNameFormat
179
class TNameFormat
163
{
180
{
164
	public:
181
	public:
165
		TNameFormat();
182
		TNameFormat();
166
		~TNameFormat();
183
		~TNameFormat();