summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-12-10 19:24:28 +0000
committerManolo Gouy <Manolo>2010-12-10 19:24:28 +0000
commit85a03a76c9035635ea4a6f87500c475b0c9bf931 (patch)
tree4963bf57493e5c1fc2c56d87ce910fd8e9f9ade9 /test
parent395f5a70aae1abbbaa2ce6be322ce197f134ef31 (diff)
Fix STR #2348. Files encoded with UTF-8 or CP1252 are accepted. Any non-UTF-8-encoded
data is interpreted according to CP1252 and transcoded to UTF-8. By default, a warning message is displayed when the input file was transcoded. This default behavior can be modified by changing a function pointer. A flag has been added to the Fl_Text_Buffer object that informs the caller if the input file was transcoded to UTF-8. The Fl_Text_Buffer.cxx file contains some preliminary code that could be used in the future to input other encodings provided they are fixed-length (e.g., all ISO-8859-* character sets, UTF-16). This code is not compiled at this point. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8004 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test')
-rw-r--r--test/editor.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/editor.cxx b/test/editor.cxx
index 6a920edae..92742ad48 100644
--- a/test/editor.cxx
+++ b/test/editor.cxx
@@ -492,6 +492,7 @@ void load_file(const char *newfile, int ipos) {
int r;
if (!insert) r = textbuf->loadfile(newfile);
else r = textbuf->insertfile(newfile, ipos);
+ changed = changed || textbuf->input_file_was_reencoded;
if (r)
fl_alert("Error reading from file \'%s\':\n%s.", newfile, strerror(errno));
else
@@ -795,6 +796,7 @@ Fl_Window* new_view() {
int main(int argc, char **argv) {
textbuf = new Fl_Text_Buffer;
+//textbuf->transcoding_warning_action = NULL;
style_init();
Fl_Window* window = new_view();