也许我不理解您的问题,但是我能够让GSON处理带引号的字符串,而无需进行任何设置或更改。
import com.google.gson.Gson;public class GSonTest { public String value; public static void main(String[] args) { Gson g = new Gson(); GSonTest gt = new GSonTest(); gt.value = "This is a "test" of quoted strings"; System.out.println("String: " + gt.value); System.out.println("JSON: " + g.toJson(gt)); }}输出:
String: This is a "test" of quoted stringsJSON: {"value":"This is a "test" of quoted strings"}也许我不明白您的要求?



