Function: mm-find-buffer-file-coding-system

Find coding system used to decode the contents of the current buffer.
This function looks for the coding system magic cookie or examines the
coding system specified by `file-coding-system-alist' being associated
with FILENAME which defaults to `buffer-file-name'. Data compressed by
gzip, bzip2, etc. are allowed.