Print Special Characters as Backslash Escapes – Python3 One-liner with Unicode Support

Let’s find that weird or invisible character that breaks your code $ echo “Hello in Finnish: Päivää”|python3 -c ‘import sys; s=sys.stdin.read(); print(s.encode(“unicode_escape”));’ b’Hello in Finnish: P\\xe4iv\\xe4\\xe4\\n’

Posted in Uncategorized | Tagged , , , , , , , , , , , , | Comments Off on Print Special Characters as Backslash Escapes – Python3 One-liner with Unicode Support

Multiple Encodings on One Server

Table of Contents Multiple Encodings on One Server Short Version for Gurus Character Encodings UTF-8 – the Best Encoding Other encodings Character Encoding Should be in Document Problem Solution Testing Advanced Stuff Links Multiple Encodings on One Server Character encoding … Continue reading

Posted in Old Site | Tagged , , , , , , , , , , , , , , | Comments Off on Multiple Encodings on One Server