Detects encoding from buffer based on BOM.
Input buffer
Detection options
Fallback encoding if detection fails (default: 'utf8')
Detected encoding: 'utf8', 'utf16le', 'utf16be', or fallback
Detects encoding from buffer based on BOM.