Commit Graph

16 Commits

Author SHA1 Message Date
Jürgen Spitzmüller
7562340249 fix unicode decomposition (bugs 3313 and 3498):
* src/support/docstring.{cpp,h}:
	- rename normalize_kc to normalize_c and use normalization form C (instead of KC)

* src/callback.cpp:
* src/Trans.cpp:
* src/frontends/qt4/GuiClipboard.cpp:
* src/frontends/qt4/GuiSelection.cpp:
* lib/lyx2lyx/lyx_1_5.py:
	- use normalization forms C and D instead of KC and KD.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18991 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-05 14:45:00 +00:00
José Matox
5cbe5cf5ad FreeBSD libc uses UCS4, but libstdc++ has no proper wchar_t support compiled in (Jean-Marc)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18913 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-27 18:02:54 +00:00
Georg Baum
0159c9d6c7 Normalize everything that comes from 'outside' (plain text import,
keyboard input via kmap, clipboard and selection) to normalized form KC
(precomposed characters) since we don't support the decomposed form very
well.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17702 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-03 08:15:39 +00:00
Georg Baum
dca251a0ef remove stray dollar sign
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17365 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-26 15:37:48 +00:00
Enrico Forestieri
b9aa557b35 Fix encoding of converters path and arguments
* src/converter.C
	(Converters::convert): Convert command to be executed to the proper
	encoding. Use from_utf8 instead of from_ascii in order to avoid
	assertions when displaying an alert.

	* src/support/docstring.[Ch]
	(to_filesystem8bit): new conversion function.

	* lib/scripts/fig2pstex.py
	* lib/scripts/fig2pdftex.py:
	Modified to reflect the changes above.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16803 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-22 02:58:47 +00:00
Georg Baum
77b9dbd557 Fix several filename and environment variable encoding problems
* src/LaTeX.C
	(LaTeX::deplog): Assume that filenames in log files are stored in
	the file system encoding

	* src/frontends/qt4/qt_helpers.[Ch]
	(internal_path): delete

	* src/frontends/qt4/QGraphics.C: Adjust to change above

	* src/frontends/qt4/QPrefsDialog.C: ditto

	* src/frontends/qt4/QExternal.C: ditto

	* src/frontends/qt4/QInclude.C: ditto

	* src/support/os.h: Document the encoding of filename arguments

	* src/support/os_win32.h: ditto

	* src/support/filetools.C
	(findtexfile): Convert filename from file system encoding

	* src/support/os_win32.C: Convert filenames from utf8 to file system
	encoding and vice versa where needed

	* src/support/os_cygwin.C: ditto

	* src/support/getcwd.C
	(getcwd): Use internal_path() with correct encoding

	* src/support/docstring.[Ch]
	(from_filesystem8bit): new conversion function

	* src/support/environment.C
	(getEnv): convert environment variable from local 8bit encoding to utf8
	(setEnv): convert environment variable from utf8 to local 8bit encoding

	* src/support/environment.h: document encoding of function arguments


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16753 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-18 20:47:27 +00:00
Georg Baum
fe5c73915e Make libQtCore a support library like boost and implement encoding conversion
from/to the local 8bit encoding with it.
Only the autotools build system is updated, scons and cmake users need to
add qt4 cpp flags when compiling libsupport, and link libsupport against
libQtCore.

	* src/frontends/qt4/qt_helpers.[Ch]
	(toqstr, qchar_to_ucs4, ucs4_to_qchar, ucs4_to_qstring,
	 qstring_to_ucs4, fromqstr): Move these qstring conversion functions
	from here ...

	* src/support/qstring_helpers.[Ch] ... to these new files

	* src/support/docstring.[Ch]
	(from_local8bit): new conversion function from local 8bit encoding
	to ucs4
	(to_local8bit): new conversion function from ucs4 to local 8bit
	encoding to ucs4
	(to_local8bit_failure): exception that is thrown by to_local8bit if
	the argument cannot be converted to the local encoding

	* src/support/filename.C
	(FileName::toFilesystemEncoding): implement with the help of QFile

	* src/support/Makefile.am: Add new files, qt4 cpp flags and link
	against libQtCore

	* src/client/client.C: Convert commandline input from local encoding
	to ucs4. Convert stuff that is sent to to the server to utf8,
	because LyX interprets it as utf8 on the other end of the pipe.

	* src/lyx_main.C
	(LyX::exec): convert commandline input from local encoding to utf8
	(LyX::init): ditto
	(LyX::easyParse): ditto

	* development/scons/scons_manifest.py: Add new files

	* config/qt4.m4: Define new variables QT4_CORE_INCLUDES,
	QT4_CORE_LDFLAGS and QT4_CORE_LIB


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16257 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-12 20:19:46 +00:00
André Pönitz
de6418f377 use more unicode in math
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15462 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-22 10:15:23 +00:00
André Pönitz
6c300f72a2 move everything into namespace lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15422 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 00:16:43 +00:00
Georg Baum
3836ff77f0 Oops, I forgot to return a reference in operator+=. This patch fixes that.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15276 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-08 09:59:17 +00:00
Georg Baum
ead66c0679 Add operator += for ASCII C strings and single ASCII chars
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15274 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-08 09:44:26 +00:00
Georg Baum
9080c44458 Use wchar_t as lyx::char_type if it is 32 bit wide.
No scons and cmake support! scons and cmake need to find out the size of
wchar_t and define this macro in config.h (example for 32bit wchar_t):

* The size of a `wchar_t', as computed by sizeof. */
#define SIZEOF_WCHAR_T 4

	* configure.ac: Test size of wchar_t

	* src/support/types.h: don't include docstring.h anymore.
	Use wchar_t as lyx::char_type if it is 32 bit wide.

	* src/support/docstring.h: Use lyx::char_type for defining docstring

	* src/metricsinfo.h: include support/docstring.h instead of
	support/types.h
	* src/lyxlex.h: ditto
	* src/frontends/font_metrics.h: ditto
	* src/frontends/qt4/qt_helpers.h: ditto
	* src/frontends/Painter.h: ditto
	* src/errorlist.h: ditto
	* src/support/lstrings.h: ditto
	* src/lyxfunc.h: ditto
	* src/LaTeX.h: ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14991 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-13 21:13:49 +00:00
Georg Baum
189d298d96 Add operator+ for ASCII characters and ASCII C strings
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14969 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-11 07:13:56 +00:00
Georg Baum
1fc0c01877 convert lfun arguments to docstring
* src/support/docstring.[Ch]
	(from_ascii): new conversion function
	(from_utf8): new conversion function
	(to_utf8): new conversion function
	(operator==) new, compare docstring and ASCII C string
	(operator!=) new, compare docstring and ASCII C string

	* src/support/Makefile.am: add new file docstring.C

	* development/scons/scons_manifest.py: ditto

	* src/funcrequest.[Ch]
	(argument): change name to argument_ and type to docstring,
	add an accessor
	(FuncRequest): Add two new constructors taking a docstring argument

	* all other files: adjust to the FuncRequest changes above


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14861 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-01 15:41:38 +00:00
Georg Baum
161db0a9ee * src/support/docstring.h: Add char_traits template functions for
gcc 3.3.x and older. They were first supplied with the libstdc++ of
	gcc 3.4.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14685 a592a061-630c-0410-9148-cb99ea01b6c8
2006-08-15 12:31:35 +00:00
Lars Gullik Bjønnes
c46b7d8955 Merge the unicode branch into trunk.
- src/support/unicode.[Ch]: new files with functions for converting
  to and fro ucs4, ucs2 and utf8.
- src/support/docstring.h: specialization of basic_string that
  holds a uint32_t internally.
- Several functions changed to use char_type instead of char or unsigned char.
- Qt3 and Qt4 sends ucs2 on to core
- Gtk sends ucs4 on to core
- Read and write utf-8 .lyx files.
- font_metrics and painter updated to handle ucs4 chars as input.
- Quite a bit of ugly compability code, conversion string->docstring, etc.
- Have fun...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14661 a592a061-630c-0410-9148-cb99ea01b6c8
2006-08-13 22:54:59 +00:00