kosmosinga Posted March 24, 2023 Share Posted March 24, 2023 Hello, everyone! Can anyone tell me how to remove the strange characters for example with a $text parameter that writes to the database and then returns that text with the database. This is text of this type, perhaps generated with a font. Anyone know how to get rid of this? s҉o҉m҉e҉t҉e҉x҉t҉ ŝ̬ô̬m̬̂ê̬t̬̂ê̬x̬̂t̬̂ and more... Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/316042-remove-strange-text-from-post-form/ Share on other sites More sharing options...
ginerjm Posted March 24, 2023 Share Posted March 24, 2023 Where is the code that produces this? Quote Link to comment https://forums.phpfreaks.com/topic/316042-remove-strange-text-from-post-form/#findComment-1606798 Share on other sites More sharing options...
kosmosinga Posted March 24, 2023 Author Share Posted March 24, 2023 I think I found a solution with iconv, but in this case the emojis (like 😋) don't work. Does anyone have any idea how to fix this? $text = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", $text2); Quote Link to comment https://forums.phpfreaks.com/topic/316042-remove-strange-text-from-post-form/#findComment-1606801 Share on other sites More sharing options...
requinix Posted March 24, 2023 Share Posted March 24, 2023 Why is it a problem? If that's what the user entered then you should be showing it back to them... Quote Link to comment https://forums.phpfreaks.com/topic/316042-remove-strange-text-from-post-form/#findComment-1606804 Share on other sites More sharing options...
kosmosinga Posted March 24, 2023 Author Share Posted March 24, 2023 The problem is that emojis don't work with iconv. At this point ŝ̬ô̬m̬̂ê̬t̬̂ê̬x̬̂t̬̂ is fine and converts the text to normal, but when I post an emoji it just doesn't work. Quote Link to comment https://forums.phpfreaks.com/topic/316042-remove-strange-text-from-post-form/#findComment-1606805 Share on other sites More sharing options...
requinix Posted March 25, 2023 Share Posted March 25, 2023 No, no, I mean what's the problem with allowing text like ŝ̬ô̬m̬̂ê̬t̬̂ê̬x̬̂t̬̂? The forum's own software is doing it right now. Quote Link to comment https://forums.phpfreaks.com/topic/316042-remove-strange-text-from-post-form/#findComment-1606812 Share on other sites More sharing options...
kicken Posted March 25, 2023 Share Posted March 25, 2023 If you want to pick and choose which characters can be used, you'll have to go through the unicode character list, decide what you do and don't want, then probably write your own filtering code for that. I dunno about you, but to me that seems like a lot of work for very little or no benefit. Quote Link to comment https://forums.phpfreaks.com/topic/316042-remove-strange-text-from-post-form/#findComment-1606822 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.