aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/basetypes/MCData.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/basetypes/MCData.cc')
-rw-r--r--src/core/basetypes/MCData.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/basetypes/MCData.cc b/src/core/basetypes/MCData.cc
index 4cd38839..0a03316c 100644
--- a/src/core/basetypes/MCData.cc
+++ b/src/core/basetypes/MCData.cc
@@ -237,15 +237,19 @@ String * Data::stringWithDetectedCharset(String * hintCharset, bool isHTML)
String * result;
String * charset;
- if (!isHintCharsetValid(hintCharset)) {
- hintCharset = NULL;
+ if (hintCharset != NULL) {
+ hintCharset = normalizeCharset(hintCharset);
}
-
- if (hintCharset == NULL) {
- charset = charsetWithFilteredHTML(isHTML);
+ if (isHintCharsetValid(hintCharset)) {
+ charset = hintCharset;
}
else {
- charset = charsetWithFilteredHTML(isHTML, hintCharset);
+ if (hintCharset == NULL) {
+ charset = charsetWithFilteredHTML(isHTML);
+ }
+ else {
+ charset = charsetWithFilteredHTML(isHTML, hintCharset);
+ }
}
if (charset == NULL) {