code: public static char[] replace(final char[] input)
  	{
  
  		int surLow = 0xD800;
  		int surHgh = 0xDFFF;
  
  		int end = input.length;
  		char[] output = new char[end];
  
  		for (int i = 0; i < end; i++) {
  			if ((int) input[i] >= surLow && input[i] <= surHgh) {
  				output[i] = '?';
  			}
  			else {
  				output[i] = input[i];
  			}
  		}
  
  		return output;
  	}
docs: Replaces all surrogates characters with '?'.
  
  @param input
  input
  @return input with '?' instead of surrogates characters