mirror of https://github.com/rusefi/rusefi-1.git
unicode
This commit is contained in:
parent
73438adc64
commit
77354f41a7
|
@ -154,7 +154,7 @@ public class AnyCommand {
|
|||
}
|
||||
|
||||
public static String unquote(String quoted) {
|
||||
quoted = quoted.trim().replace('“', '"').replace('”', '"');
|
||||
quoted = quoted.trim().replace('\u201C', '"').replace('\u201D', '"');
|
||||
if (quoted.charAt(0) == '"')
|
||||
return quoted.substring(1, quoted.length() - 1);
|
||||
return quoted; // ignoring invalid input
|
||||
|
|
|
@ -29,9 +29,9 @@ public class AnyCommandTest {
|
|||
@Test
|
||||
public void testSetFSIOexpressionWithFunnyQuotes() {
|
||||
assertEquals("tps > 10", AnyCommand.unquote("\"tps > 10\""));
|
||||
assertEquals("tps > 10", AnyCommand.unquote("“tps > 10”"));
|
||||
assertEquals("tps > 10", AnyCommand.unquote("\u201Ctps > 10\u201D"));
|
||||
|
||||
|
||||
assertEquals("set_rpn_expression 1 \"tps 10 >\"", AnyCommand.prepareCommand("Set_fsio_expression 1 “tps > 10”"));
|
||||
assertEquals("set_rpn_expression 1 \"tps 10 >\"", AnyCommand.prepareCommand("Set_fsio_expression 1 \u201Ctps > 10\u201D"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue