Fix T38645 - Mouse reversed in standalone player with kde

Reviewers: moguri

Differential Revision: https://developer.blender.org/D344
Code cleanup: use lowercase names for vars
MSVC: resolve utf8 encoding issue with some codepages
Fix T38769: Python missing access to text materials
T38763 Fix: avoid NPE When no custom properties are defined