Closed talhatokur closed 4 years ago
Are you sure UTF-8 is enabled on your site/form? Also are you getting errors, if so what?
I wrote the username (şük) and got the following error.
Oops. Can not find this Habbo!
Try to catch this exception gracefully in your application!
[0] Unknown HabboAPI exception occurred: An unknown HTML page was returned
I understand that there is something encoded somewhere, I did not get any effect even though I made the character encoding utf-8.
I tried two ways to fix it, I corrected the encoding of characters, but this time the special letters returned as a question mark.
$habbo = @$_GET["user"];
if (mb_detect_encoding($habbo, 'utf-8', true) === false) {
$habbo = mb_convert_encoding($habbo, 'utf-8', 'iso-8859-1');
}
$myHabbo = $habboApi->getHabbo($habbo);
This didn't work, it turned the same.
I tried a second way.
$myHabbo = $habboApi->getHabbo(mb_convert_encoding(utf8_decode($habbo), 'utf-8', 'iso-8859-1'));
This time it worked, but special characters just returned as question marks. I couldn't reach my goal. This is a necessary system for me, I think there is a character loop somewhere, I expect your response as soon as possible :)
I think the problem your form/page is not UTF-8. If you say the second way works, but the page shows question marks afterwards then that's probably an indication.
I am primarily sending UTF8 encoding,
header("Content-Type: text/html; charset=utf-8");
But nothing has changed.
Because there is no problem with special characters in a normal string value.
$username = "şçöğüı"; echo $username
Output : şçöğüı
In this case, the output turns out to be normal, but special characters return very differently when using functions.
$myHabbo = $habboApi->getHabbo("şçöğüı");
The whole problem arises when I use this function, whereas the site has utf8 encoding. I think there is a system-related error, could you please try and solve the error on the workspace? thx
I need motto authentication to register users on fansite and I'm having trouble registering users with special characters (ö, ş, ğ, ı, etc.), looking for a solution.