swiftmailer/swiftmailer — pull request #444 by mbunzel (2014-03-19 22:48:35+00:00)
Title: Incorrect character encoding due to transposed arguments for mbstring_convert_encoding

Depending on which extension is installed, swiftmailer will call mb_convert_encoding($string, $charset, 'utf-8') or iconv($charset, 'utf-8//TRANSLIT//IGNORE', $string).

The signatures of these functions are mb_convert_encoding($str, $to_encoding, $from_encoding) and iconv($in_charset, $out_charset, string $str).

-> those two function calls do the exact opposite of each other. Users with installed mbstring extension will experience garbled output if the specified charset is any value other than utf-8 or iso-8850-1, in which case the conversion is skipped.

This pull request fixes the transposed arguments so that both mbstring and iconv will convert *from* $charset *to* utf-8.