fixed character encodings and use proper phpbb functions