1 #include <iostream>
2 #include <fstream>
3 #include <string>
4 #include <stack>
12 // Character encoding conversions
24 };
31 }
34 }
35 };
50 }
51 }
57 }
58 }
59 };
73 }
75 }
80 }
83 }
86 }
89 }
92 }
94 std::string str = convert((char *)piece->getBuffer(), piece->size() + 1, (char *)"ISO-8859-1", 1);
96 }
100 }
102 /**
103 * Convert an input character buffer in the given encoding to the
104 * locale's encoding.
105 */
107 // Convert from the input encoding to the locale's encoding
110 // Handle errors by throwing a readable message
115 }
117 // Assume at most 4 bytes per character are needed
120 // Allocate the output buffer
124 // Perform conversion
130 }
132 // Free the iconv state
135 // Copy result into a std::string
139 // Convert newlines
142 }
145 }
146 };
157 }
160 }
162 }
163 }
168 }
170 // Set the locale according to the terminal's environment
184 }
185 // std::cout << s->toPlainText() << std::endl;
186 // std::cout << std::endl << std::endl;
194 }
195 // std::cout << s->toString() << std::endl;
196 // std::cout << in.tellg() << " " << in.eof() << std::endl;
198 // odc::TypePath path;
199 // odc::ContainerModel(0).getTypePath(&path);
200 // std::cout << path.toString() << std::endl;
202 }