Given data, it looks at the BOM to detect which encoding, and converts the text from that encoding into UTF-8.
See Implementation
Given data, it looks at the BOM to detect which encoding, and converts the text from that encoding into UTF-8.