aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/Converter.h
diff options
context:
space:
mode:
authornyamatongwe <unknown>2006-06-08 09:04:36 +0000
committernyamatongwe <unknown>2006-06-08 09:04:36 +0000
commit431b0992d1661937b920ff9a23f327ecce883cfa (patch)
tree185980264bcc9319a5cbc668efef3f05b0da6104 /gtk/Converter.h
parent3aed66b6791cbcce779ececad69e829963e88713 (diff)
downloadscintilla-mirror-431b0992d1661937b920ff9a23f327ecce883cfa.tar.gz
Added support for //TRANSLIT option to iconv to allow approximate
conversions, such as when pasting UTF-8 text and the buffer is set to an encoding that does not support all of the characters on the clipboard.
Diffstat (limited to 'gtk/Converter.h')
-rw-r--r--gtk/Converter.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/gtk/Converter.h b/gtk/Converter.h
index 09f213a66..7dc2e6875 100644
--- a/gtk/Converter.h
+++ b/gtk/Converter.h
@@ -27,9 +27,9 @@ public:
Converter() {
iconvh = iconvhBad;
}
- Converter(const char *charSetDestination, const char *charSetSource) {
+ Converter(const char *charSetDestination, const char *charSetSource, bool transliterations) {
iconvh = iconvhBad;
- Open(charSetDestination, charSetSource);
+ Open(charSetDestination, charSetSource, transliterations);
}
~Converter() {
Close();
@@ -37,13 +37,18 @@ public:
operator bool() const {
return iconvh != iconvhBad;
}
- void Open(const char *charSetDestination, const char *charSetSource) {
+ void Open(const char *charSetDestination, const char *charSetSource, bool transliterations=true) {
Close();
if (*charSetSource) {
+ char fullDest[200];
+ strcpy(fullDest, charSetDestination);
+ if (transliterations) {
+ strcat(fullDest, "//TRANSLIT");
+ }
#if GTK_MAJOR_VERSION >= 2
- iconvh = g_iconv_open(charSetDestination, charSetSource);
+ iconvh = g_iconv_open(fullDest, charSetSource);
#else
- iconvh = iconv_open(charSetDestination, charSetSource);
+ iconvh = iconv_open(fullDest, charSetSource);
#endif
}
}