mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 10:51:03 +00:00
fa1856440c
* src/encoding.h (encoding_table): remove, this is no longer needed with unicode (iconvName_): new member: name of the encoding in iconv syntax * src/exporter.C (Exporter::Export): Use return value of Buffer::makeLaTeXFile * src/buffer.[Ch] (Buffer::makeLaTeXFile): return whether the file has been created successfully * src/buffer.C (Buffer::makeLaTeXFile): Use a docstream that converts to the correct encoding Display an error dialog is something went wrong * src/bufferparams.C (BufferParams::writeLaTeX): Undo the utf8 inputenc hack * src/frontends/qt4/QDocumentDialog.C: Add some FIXMEs * src/support/unicode.[Ch] (eightbit_to_ucs4): New conversion function (ucs4_to_eightbit): New conversion function * src/support/docstream.[Ch] (utf8_codecvt_facet_exception): Move to header and rename to iconv_codecvt_facet_exception (odocfstream): Take the encoding as argument * src/support/docstream.C (utf8_codecvt_facet): Generalize to other encodings than utf8 and rename to iconv_codecvt_facet * src/encoding.C: Remove obsolete tables * src/output_latex.C (TeXOnePar): Convert the paragraph to different encoding if needed * lib/encodings: Remove obsolete tables git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15564 a592a061-630c-0410-9148-cb99ea01b6c8
99 lines
1.7 KiB
C++
99 lines
1.7 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file encoding.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Lars Gullik Bjønnes
|
|
* \author Jean-Marc Lasgouttes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef ENCODING_H
|
|
#define ENCODING_H
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
#include "support/types.h"
|
|
|
|
namespace lyx {
|
|
|
|
///
|
|
class Encoding {
|
|
public:
|
|
///
|
|
Encoding() {}
|
|
///
|
|
Encoding(std::string const & n, std::string const & l,
|
|
std::string const & i)
|
|
: Name_(n), LatexName_(l), iconvName_(i)
|
|
{
|
|
}
|
|
///
|
|
std::string const & name() const { return Name_; }
|
|
///
|
|
std::string const & latexName() const { return LatexName_; }
|
|
///
|
|
std::string const & iconvName() const { return iconvName_; }
|
|
private:
|
|
///
|
|
std::string Name_;
|
|
///
|
|
std::string LatexName_;
|
|
///
|
|
std::string iconvName_;
|
|
};
|
|
|
|
extern Encoding symbol_encoding;
|
|
|
|
class Encodings {
|
|
public:
|
|
///
|
|
typedef std::map<std::string, Encoding> EncodingList;
|
|
///
|
|
Encodings();
|
|
///
|
|
void read(std::string const & filename);
|
|
///
|
|
Encoding const * getEncoding(std::string const & encoding) const;
|
|
///
|
|
Encoding const * symbol_encoding() { return &symbol_encoding_; }
|
|
|
|
///
|
|
enum Letter_Form {
|
|
///
|
|
FORM_ISOLATED,
|
|
///
|
|
FORM_FINAL,
|
|
///
|
|
FORM_INITIAL,
|
|
///
|
|
FORM_MEDIAL
|
|
};
|
|
///
|
|
static bool isComposeChar_hebrew(char_type c);
|
|
///
|
|
static bool isComposeChar_arabic(char_type c);
|
|
///
|
|
static bool is_arabic_special(char_type c);
|
|
///
|
|
static bool is_arabic(char_type c);
|
|
///
|
|
static char_type transformChar(char_type c, Letter_Form form);
|
|
|
|
private:
|
|
///
|
|
EncodingList encodinglist;
|
|
///
|
|
Encoding symbol_encoding_;
|
|
};
|
|
|
|
extern Encodings encodings;
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
#endif
|