aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Pöschel <github@basicmaster.de>2017-02-11 01:15:53 +0100
committerStefan Pöschel <github@basicmaster.de>2017-02-11 01:15:53 +0100
commitb808b7bfecbee44527c4faa6f9cc16ed44b73a34 (patch)
tree3c9c1ac13d68501bdaa6845c7ee3019fc273dabb
parentb18c8ea7c49f0e33f6fa5bd8ea467562cce260f1 (diff)
downloadODR-PadEnc-b808b7bfecbee44527c4faa6f9cc16ed44b73a34.tar.gz
ODR-PadEnc-b808b7bfecbee44527c4faa6f9cc16ed44b73a34.tar.bz2
ODR-PadEnc-b808b7bfecbee44527c4faa6f9cc16ed44b73a34.zip
Move charset to separate source file to prevent multi-include errors
-rw-r--r--Makefile.am1
-rw-r--r--src/charset.cpp54
-rw-r--r--src/charset.h29
3 files changed, 56 insertions, 28 deletions
diff --git a/Makefile.am b/Makefile.am
index fac92c2..6e2a78c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,6 +15,7 @@ odr_padenc_SOURCES = \
src/common.h \
src/pad_common.cpp \
src/pad_common.h \
+ src/charset.cpp \
src/charset.h \
src/crc.cpp \
src/crc.h
diff --git a/src/charset.cpp b/src/charset.cpp
new file mode 100644
index 0000000..2ee14f8
--- /dev/null
+++ b/src/charset.cpp
@@ -0,0 +1,54 @@
+/*
+ Copyright (C) 2015 Matthias P. Braendli (http://opendigitalradio.org)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+/*!
+ \file charset.cpp
+ \brief Define the EBU charset according to ETSI TS 101 756v1.8.1 for DLS encoding
+
+ \author Matthias P. Braendli <matthias@mpb.li>
+ \author Lindsay Cornell
+*/
+
+#include "charset.h"
+
+/**********************************************/
+/************* BIG FAT WARNING ****************/
+/**********************************************/
+/**** Make sure this file is always saved ****/
+/**** encoded in UTF-8, otherwise you will ****/
+/**** mess up the table below ! ****/
+/**********************************************/
+/********* END OF BIG FAT WARNING *************/
+/**********************************************/
+
+
+const char* utf8_encoded_EBU_Latin[CHARSET_TABLE_ENTRIES] = {
+ "Ę", "Į", "Ų", "Ă", "Ė", "Ď", "Ș", "Ț", "Ċ", "\n","\v","Ġ", "Ĺ", "Ż", "Ń",
+"ą", "ę", "į", "ų", "ă", "ė", "ď", "ș", "ț", "ċ", "Ň", "Ě", "ġ", "ĺ", "ż", "\u0082",
+" ", "!", "\"","#", "ł", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/",
+"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?",
+"@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O",
+"P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "Ů", "]", "Ł", "_",
+"Ą", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
+"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "«", "ů", "»", "Ľ", "Ħ",
+"á", "à", "é", "è", "í", "ì", "ó", "ò", "ú", "ù", "Ñ", "Ç", "Ş", "ß", "¡", "Ÿ",
+"â", "ä", "ê", "ë", "î", "ï", "ô", "ö", "û", "ü", "ñ", "ç", "ş", "ğ", "ı", "ÿ",
+"Ķ", "Ņ", "©", "Ģ", "Ğ", "ě", "ň", "ő", "Ő", "€", "£", "$", "Ā", "Ē", "Ī", "Ū",
+"ķ", "ņ", "Ļ", "ģ", "ļ", "İ", "ń", "ű", "Ű", "¿", "ľ", "°", "ā", "ē", "ī", "ū",
+"Á", "À", "É", "È", "Í", "Ì", "Ó", "Ò", "Ú", "Ù", "Ř", "Č", "Š", "Ž", "Ð", "Ŀ",
+"Â", "Ä", "Ê", "Ë", "Î", "Ï", "Ô", "Ö", "Û", "Ü", "ř", "č", "š", "ž", "đ", "ŀ",
+"Ã", "Å", "Æ", "Œ", "ŷ", "Ý", "Õ", "Ø", "Þ", "Ŋ", "Ŕ", "Ć", "Ś", "Ź", "Ť", "ð",
+"ã", "å", "æ", "œ", "ŵ", "ý", "õ", "ø", "þ", "ŋ", "ŕ", "ć", "ś", "ź", "ť", "ħ"};
diff --git a/src/charset.h b/src/charset.h
index a31ca25..3b5f102 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -32,36 +32,9 @@
#include <vector>
#include <algorithm>
-/**********************************************/
-/************* BIG FAT WARNING ****************/
-/**********************************************/
-/**** Make sure this file is always saved ****/
-/**** encoded in UTF-8, otherwise you will ****/
-/**** mess up the table below ! ****/
-/**********************************************/
-/********* END OF BIG FAT WARNING *************/
-/**********************************************/
-
-
#define CHARSET_TABLE_OFFSET 1 // NUL at index 0 cannot be represented
#define CHARSET_TABLE_ENTRIES (256 - CHARSET_TABLE_OFFSET)
-const char* utf8_encoded_EBU_Latin[CHARSET_TABLE_ENTRIES] = {
- "Ę", "Į", "Ų", "Ă", "Ė", "Ď", "Ș", "Ț", "Ċ", "\n","\v","Ġ", "Ĺ", "Ż", "Ń",
-"ą", "ę", "į", "ų", "ă", "ė", "ď", "ș", "ț", "ċ", "Ň", "Ě", "ġ", "ĺ", "ż", "\u0082",
-" ", "!", "\"","#", "ł", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/",
-"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?",
-"@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O",
-"P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "Ů", "]", "Ł", "_",
-"Ą", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
-"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "«", "ů", "»", "Ľ", "Ħ",
-"á", "à", "é", "è", "í", "ì", "ó", "ò", "ú", "ù", "Ñ", "Ç", "Ş", "ß", "¡", "Ÿ",
-"â", "ä", "ê", "ë", "î", "ï", "ô", "ö", "û", "ü", "ñ", "ç", "ş", "ğ", "ı", "ÿ",
-"Ķ", "Ņ", "©", "Ģ", "Ğ", "ě", "ň", "ő", "Ő", "€", "£", "$", "Ā", "Ē", "Ī", "Ū",
-"ķ", "ņ", "Ļ", "ģ", "ļ", "İ", "ń", "ű", "Ű", "¿", "ľ", "°", "ā", "ē", "ī", "ū",
-"Á", "À", "É", "È", "Í", "Ì", "Ó", "Ò", "Ú", "Ù", "Ř", "Č", "Š", "Ž", "Ð", "Ŀ",
-"Â", "Ä", "Ê", "Ë", "Î", "Ï", "Ô", "Ö", "Û", "Ü", "ř", "č", "š", "ž", "đ", "ŀ",
-"Ã", "Å", "Æ", "Œ", "ŷ", "Ý", "Õ", "Ø", "Þ", "Ŋ", "Ŕ", "Ć", "Ś", "Ź", "Ť", "ð",
-"ã", "å", "æ", "œ", "ŵ", "ý", "õ", "ø", "þ", "ŋ", "ŕ", "ć", "ś", "ź", "ť", "ħ"};
+extern const char* utf8_encoded_EBU_Latin[CHARSET_TABLE_ENTRIES];
class CharsetConverter
{