added fil_json_escape filter

This commit is contained in:
2021-10-21 13:42:41 +02:00
parent a327a26bd5
commit d6d5236a03
3 changed files with 18 additions and 0 deletions

View File

@@ -34,6 +34,9 @@
#include "templates.h"
#include "core/misc.h"
#include "convert/misc.h"
namespace Winix
{
@@ -165,6 +168,19 @@ void fil_csv_escape(Info & i)
}
void fil_json_escape(Info & i)
{
pt::WTextStream str;
for(size_t a=0 ; a < i.in.size() ; ++a)
{
wchar_t c = i.in.get_wchar(a);
pt::esc_to_json(c, str);
i.out << R(str);
str.clear();
}
}
void fil_new_line_to_br(Info & i)
{