[SP-1212] - Added check to prevent double escape of already escaped strings - Cherry picked from 52c01343ff6defb12aba87e0b7065ab34b1c7d03