aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.cpp
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-02-08 07:55:37 -0200
committerHugo Lima <hugo.lima@openbossa.org>2010-02-08 14:14:11 -0200
commita0c267b10ad01064e9282ea38577cbd71d0944af (patch)
tree1277fda28d4424ec72f19b53f3706dd6cbe39e99 /typesystem.cpp
parent31234b1869a66d161fd6b916823cae66d03e22f7 (diff)
Code injection from external files are always read using UTF-8.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'typesystem.cpp')
-rw-r--r--typesystem.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/typesystem.cpp b/typesystem.cpp
index ca40332b6..220d5af1e 100644
--- a/typesystem.cpp
+++ b/typesystem.cpp
@@ -1541,10 +1541,9 @@ bool Handler::startElement(const QString &, const QString &n,
m_generate != TypeEntry::GenerateNothing &&
!file_name.isEmpty()) {
if (QFile::exists(file_name)) {
- QFile code_file(file_name);
- if (code_file.open(QIODevice::ReadOnly)) {
- QString content;
- content = code_file.readAll();
+ QFile codeFile(file_name);
+ if (codeFile.open(QIODevice::Text | QIODevice::ReadOnly)) {
+ QString content = QString::fromUtf8(codeFile.readAll());
content.prepend("// ========================================================================\n"
"// START of custom code block [file: " + file_name + "]\n");
content.append("\n// END of custom code block [file: " + file_name + "]\n"