Ticket #1485500 (closed Patches: worksforme)

Opened 3 months ago

Last modified 2 months ago

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

Changed 3 months ago by ilifeis

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);
  }

Changed 3 months ago by alec

Please attach sample message for testing.

Changed 2 months ago by alec

  • status changed from new to closed
  • resolution set to worksforme

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.

Note: See TracTickets for help on using tickets.