New: load_buffer function, for retrieve correct document encoding.