Opened 5 years ago
Closed 5 years ago
#1485500 closed Feature Patches (worksforme)
International encoding with UTF8 in Washtml.php
| Reported by: | ilifeis | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.2-stable |
| Component: | PHP backend | Version: | 0.2-beta |
| Severity: | major | Keywords: | washtml, thai, encoding |
| Cc: |
Description
I found problem when use washtml in thai encoding with UTF-8, it cannot show thai encoding. Then I correct this problem with mb_convert_encoding;
CODE: ->
public function wash($html) {
Charset seems to be ignored (probably if defined in the HTML document)
$node = new DOMDocument('1.0', $this->configcharset?);
$this->extlinks = false;
$html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8");
@$node->loadHTML($html);
return $this->dumpHtml($node);
}
Change History (3)
comment:1 Changed 5 years ago by ilifeis
comment:2 Changed 5 years ago by alec
Please attach sample message for testing.
comment:3 Changed 5 years ago by alec
- Resolution set to worksforme
- Status changed from new to closed
Without sample message we can check the issue. Since http://trac.roundcube.net/changeset/1487/ there mb_convert_encoding() shouldn't be needed. Closing for now.

Sorry for code use this:
and change UTF-8 to config charset
public function wash($html) { //Charset seems to be ignored (probably if defined in the HTML document) $node = new DOMDocument('1.0', $this->config['charset']); $this->extlinks = false; echo $html; $html = mb_convert_encoding($html, 'HTML-ENTITIES', $this->config['charset']); @$node->loadHTML($html); return $this->dumpHtml($node); }