Here you can find the source of sanitize(String text)
private static String sanitize(String text)
//package com.java2s; /******************************************************************************* * Copyright (c) 2015 Jeremie Bresson./*from w w w . j av a2s . com*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Jeremie Bresson - initial API and implementation ******************************************************************************/ public class Main { private static final String CHAR_QUOTE = "\""; private static final String CHAR_8220 = Character.toString((char) 8220); private static final String CHAR_8221 = Character.toString((char) 8221); private static final String CHAR_8222 = Character.toString((char) 8222); private static String sanitize(String text) { String result = text; result = result.replaceAll(CHAR_8220, CHAR_QUOTE); result = result.replaceAll(CHAR_8221, CHAR_QUOTE); result = result.replaceAll(CHAR_8222, CHAR_QUOTE); return result; } }