encodings, text transformations, and locale-specific text handling OK and fixes from jsing@ kspillner@