mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-11-18 18:07:48 +01:00
added support for backslash
otherwise \ isn't being sent normally ( or not being read)
This commit is contained in:
@@ -1394,12 +1394,14 @@ class Contact {
|
|||||||
|
|
||||||
String addEscapeChars(String str) {
|
String addEscapeChars(String str) {
|
||||||
String temp = str.replaceAll("\"", "\\\"");
|
String temp = str.replaceAll("\"", "\\\"");
|
||||||
|
temp = temp.replaceAll("\\", "\\\\");
|
||||||
return temp.replaceAll("\n", "\\n");
|
return temp.replaceAll("\n", "\\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
String unEscapeChars(String str) {
|
String unEscapeChars(String str) {
|
||||||
//print("in unEscape: |$str|");
|
//print("in unEscape: |$str|");
|
||||||
String temp = str.replaceAll("\"", "\\\"");
|
String temp = str.replaceAll("\"", "\\\"");
|
||||||
|
temp = temp.replaceAll("\\\\", "\\");
|
||||||
temp = temp.replaceAll("\n", "\\n");
|
temp = temp.replaceAll("\n", "\\n");
|
||||||
//print("returning |$temp|\n");
|
//print("returning |$temp|\n");
|
||||||
return temp;
|
return temp;
|
||||||
|
|||||||
Reference in New Issue
Block a user