aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/Converter.h
diff options
context:
space:
mode:
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
}
}