I have to handle this scenario in Java:
I\'m getting a request in XML form from a client with declared encoding=utf-8. Unfortunately it may contain not utf-8 charact
"test text".replaceAll("[^\\u0000-\\uFFFF]", "");
This code removes all 4-byte utf8 chars from string.This can be needed for some purposes while doing Mysql innodb varchar entry