Thread Wie dekodieren und UTF8 formatieren? (5 answers)
Opened by Henry at 2024-03-04 16:17

GwenDragon
 2024-03-04 22:20
#195897 #195897
User since
2005-01-17
14619 articles
Admin1
[Homepage]
user image
Um sowas korrekt zu machen, gibt es fertige Module.

Perl:
https://perldoc.perl.org/MIME::QuotedPrint
https://perldoc.perl.org/Encode
Code: (dl )
1
2
3
4
5
use MIME::QuotedPrint;
use Encode;

$zeile = MIME::QuotedPrint::decode_qp($zeile);
$utf_string = Encode::encode("utf-8", $zeile);


PHP:
https://www.php.net/manual/de/function.quoted-prin...
https://www.php.net/manual/de/function.utf8-encode...
https://www.php.net/manual/de/function.mb-convert-...
Code: (dl )
1
2
3
4
5
$zeile = quoted_printable_decode($zeile);
/* veraltet */
$zeile = utf8_encode($zeile);
/* oder bevorzugt seit PHP 8.2 */
$zeile = mb_convert_encoding($zeile, "UTF-8");

Last edited: 2024-03-06 08:58:24 +0100 (CET)

View full thread Wie dekodieren und UTF8 formatieren?