0

Here is the code:

    var disqus_title="UnicodeDecodeError - ordinal not in range(128)";
    var disqus_identifier="cache\yazilar\python\unicode-decode-error-ordinal-not-in-range.html";
    var disqus_config = function () {
        this.language = "tr";
    };

Chrome's debugging tool suggest that there is a syntax error in disqus_identifier line, but I can't find it. I use same code in all of my pages and only this one gives error.

4 Answers 4

2

The backslash \ is an escape character in javascript. If you want a backslash in your string, you have to escape it with another backslash.

var disqus_identifier="cache\\yazilar\\python\\unicode-decode-error-ordinal-not-in-range.html";
Sign up to request clarification or add additional context in comments.

Comments

2

You need to double the backslashes in your string constant.

var disqus_identifier="cache\\yazilar\\python\\unicode-decode-error-ordinal-not-in-range.html";

It might be a good idea to make sure that you really want those backslashes and not forward-slash characters. If you're passing a path back to your server and your server's going to just use it blindly, that might be a fairly nasty security issue.

Comments

1

\u indicates a unicode escape. It must be followed by 4 hexidecimal characters.

You should probably either replace your \ characters with \\ (the escape sequence used to represent \ as data) or (since what you have looks like a relative URI) use / instead.

Comments

0

var disqus_identifier="cache\yazilar\python\unicode-decode-error-ordinal-not-in-range.html";

Single Backslash confuse Script Compiler.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.