How do I encode Unicode character codes in a PowerShell string literal?

Replace ‘\u’ with ‘0x’ and cast it to System.Char: PS > [char]0x0048 H You can also use the “$()” syntax to embed a Unicode character into a string: PS > “Acme$([char]0x2122) Company” AcmeT Company Where T is PowerShell’s representation of the character for non-registered trademarks. Note: this method works only for characters in Plane 0, … Read more

Any gotchas using unicode_literals in Python 2.6?

The main source of problems I’ve had working with unicode strings is when you mix utf-8 encoded strings with unicode ones. For example, consider the following scripts. two.py # encoding: utf-8 name=”helló wörld from two” one.py # encoding: utf-8 from __future__ import unicode_literals import two name=”helló wörld from one” print name + two.name The output … Read more