+
+
+char *
+translate_octal(
+ char *line)
+{
+ char *s = line, *s1, *s2;
+ char *p = line;
+ int i;
+
+ if (!translate_mode)
+ return strdup(line);
+
+ while(*s != '\0') {
+ if ((s == line || *(s-1) != '\\') && *s == '\\') {
+ s++;
+ s1 = s+1;
+ s2 = s+2;
+ if (g_ascii_isdigit(*s) && *s1 != '\0' &&
+ g_ascii_isdigit(*s1) &&
+ g_ascii_isdigit(*s2)) {
+ i = ((*s)-'0')*64 + ((*s1)-'0')*8 + ((*s2)-'0');
+ *p++ = i;
+ s += 3;
+ } else {
+ *p++ = *s++;
+ }
+
+ } else {
+ *p++ = *s++;
+ }
+ }
+ *p = '\0';
+
+ return line;
+}
+