MyBB Community Forums

Full Version: Unicode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was trying to make a plugin, it works nice, and parses the content of two tags. The problem is that when i get the post['message'], it seems I loose unicode fonts or whatever and i get ???? instead of some fonts like è ò, and so on. What can I do in order to avoid this encoding problem?
Well the encoding depends mostly on the forums itself. You may want to use some of the php functions for encoding too.

http://us3.php.net/manual/en/function.mb...coding.php
and
http://us3.php.net/manual/en/function.mb...coding.php

Hope that helps..maybe if you post the part you are having issue with we can help out.
I'll try to explain better, i don't want to convert the encoding.
Lets' say we have
$str = $post['message'];
where message is the content of the text box when I'm, posting.
I want to work on this string without loosing special fonts, and output the final result. (i work on the string with preg_replace, strlen and so on).
Those characters are multi-byte, so you have to use the mbstrings equivalent string functions.
I think it's mb_strlen for strlen .. You can probably check up in the manual.