Detect system encoding