buffer: ignore case of encoding for all functions