Feed burner changed their blog service return results that it returns blocks of javascript similar to:
document.write(\"\\x3cdiv class\\x3d\\x22feed
That is a PHP Twig encoding:
http://www.twig-project.org/
Since you are using C# you will most likely have to create a dictionary to translate the symbols and then use a series of .Replace()
string methods to convert those back to HTML characters.
Alternatively you can save that data to a file, run a Perl script to decode the text and then read from the file in C#, but that might be more costly.
In dotnet core you can use Uri.UnescapeDataString(originalString.Replace("\x","%")) to convert it by making it into a Url encoded string first.
Those look like ASCII values, encoded in hex. You could traverse the string, and whenever you find a \x
followed by two hexadecimal digits (0-9,a-f), replace it with the corresponding ASCII character. If the string is long, it would be faster to save the result incrementally to a StringBuilder
instead of using String.Replace()
.
I don't know the encoding specification, but there might be more rules to follow (for example, if \\
is an escape character for a literal \
).