Strange string export of character '/'

Discussion and help for Easy Save 3
Post Reply
Gladyon
Posts: 30
Joined: Thu Sep 07, 2017 6:51 am

Strange string export of character '/'

Post by Gladyon »

Is there a specific reason for the character '/' to be written as "\/"?
It makes the output file quite unreadable, and very hard to manually modify by users (currently a string containing a date is exported as "5\/11\/2018"...).
In order to put it into the context, I am modifying the DateTime import/export in order not to use the Tick as it is mostly unreadable by any human in order to have:

Code: Select all

"Date": "5/11/2018"
Instead of:

Code: Select all

"Date": 
{
    "ticks": 636616346703609218
}

So, I'd like to know if I can safely modify 'ES3JSONWriter.WritePrimitive(string value)' by commenting the line:

Code: Select all

case '/':
Note that all the other 'case' are corresponding to the unused method 'CharacterRequiresEscaping()', which seems to indicate that it is actually safe to comment the line I'd like to comment.



By the way, I know that I have a 6 months old version (which I will soon upgrade so I should stop reporting already fixed bugs) so it's probably already fixed, but just in case, I saw that:

Code: Select all

public class ES3Type_StringArray : ES3ArrayType
{
	public static ES3Type Instance;

	public ES3Type_StringArray() : base(typeof(Quaternion[]), ES3Type_Quaternion.Instance)
	{
		Instance = this;
	}
}
I think that 'Quaternion' should be replaced by 'String'.
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Strange string export of character '/'

Post by Joel »

Hi there,

The JSON schema we use requires that forward-slashes are escaped. However, you should be fine to comment it out. Though do note that we cannot provide support for modified code.

With regards to the Quaternion/String bug, this appears to be resolved in the current update, and should indeed be string.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply