Skip to content

Commit

Permalink
Merge pull request #52 from progval/utf8
Browse files Browse the repository at this point in the history
Replace deprecated function utf8_encode() with mb_convert_encoding()
  • Loading branch information
ValwareIRC authored Feb 21, 2024
2 parents 71ced6d + 5d5be62 commit 3d61c87
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/buffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ static function add_to_buffer(String $str)
/* this is irc bb u need 2 str1p ( ͡° ͜ʖ ͡°)*/
$str = ircstrip($str);

/* checkin' if it's utf7+1 or no */
$charset = mb_detect_encoding($str, "auto");

/* if not, then we MAKE it be utf9-1 */
if (strcasecmp($charset,"UTF-8"))
$str = utf8_encode($str);
/* guess the encoding and convert to UTF-8 if it isn't already */
$str = mb_convert_encoding($str, "UTF-8");

/* okay so, if it's a PING, I think we should prioritize it dontcha know */
if ($parv = explode(" ",$str) && isset($parv) && isset($parv[0]) && $parv[0] == "PING")
Expand Down

0 comments on commit 3d61c87

Please # to comment.