summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2006-04-15 02:13:39 +0000
committerMatthias Melcher <fltk@matthiasm.com>2006-04-15 02:13:39 +0000
commiteea06b4d6fc8a350c047bffa6c3f3b745f607b79 (patch)
tree720ba684bc219dba630dc5068376bf4a5cfcb786
parent8c9fb5465c4a51f812392e6c74064d9b4559b8c4 (diff)
in preperation of STR#1195: On OS X, we don't need to do the octal conversion because all characters in MacROman are defiend.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4955 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Input_.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index 41ddcaa26..9d9150e01 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -84,6 +84,12 @@ const char* Fl_Input_::expand(const char* p, char* buf) const {
*o++ = '^';
*o++ = c ^ 0x40;
}
+#ifdef __APPLE__
+ // In MacRoman, all characters are defined, and non-break-space is 0xca
+ } else if (c == 0xCA) { // nbsp
+ *o++ = ' ';
+#else
+ // in ISO 8859-1, undefined characters are rendered as octal
} else if (c >= 128 && c < 0xA0) {
// these codes are not defined in ISO code, so we output the octal code instead
*o++ = '\\';
@@ -92,6 +98,7 @@ const char* Fl_Input_::expand(const char* p, char* buf) const {
*o++ = (c&0x07) + '0';
} else if (c == 0xA0) { // nbsp
*o++ = ' ';
+#endif
} else {
*o++ = c;
}
@@ -114,9 +121,13 @@ double Fl_Input_::expandpos(
if (c < ' ' || c == 127) {
if (c == '\t' && input_type()==FL_MULTILINE_INPUT) n += 8-(n%8);
else n += 2;
+#ifdef __APPLE__
+ // in MacRoman, all characters are defined
+#else
} else if (c >= 128 && c < 0xA0) {
// these codes are not defined in ISO code, so we output the octal code instead
n += 4;
+#endif
} else {
n++;
}