Код: Выделить всё
@Test
public void testIllegalCharacter(){
String input = "prop=\\asd";
Config conf = ConfigFactory.parseString(input);
}
< /code>
Приведенный выше код создает следующую ошибку: < /p>
com.typesafe.config.ConfigException$Parse: String: 1: Expecting a value but got wrong token: '\' (Reserved character '\' is not allowed outside quotes) (if you intended '\' (Reserved character '\' is not allowed outside quotes) to be part of a key or string value, try enclosing the key or value in double quotes, or you may be able to rename the file .properties rather than .conf)
< /code>
Я понимаю, что у меня есть нелегальный символ в моей строке. Хотя как мне найти полный набор незаконных символов? .parseProperties В качестве альтернативы кто -то может указать на все зарезервированные символы? < /strong> < /p>
Много Спасибо
Подробнее здесь: https://stackoverflow.com/questions/390 ... characters