func ToUTF16Column(p Point, content []byte) (int, error) {
	if !p.HasPosition() {
		return -1, fmt.Errorf("ToUTF16Column: point is missing position")
	}
	if !p.HasOffset() {
		return -1, fmt.Errorf("ToUTF16Column: point is missing offset")
	}
	offset := p.Offset()       
	colZero := p.Column() - 1  
	if colZero == 0 {
		return 1, nil
	} else if colZero < 0 {
		return -1, fmt.Errorf("ToUTF16Column: column is invalid (%v)", colZero)
	}
	lineOffset := offset - colZero
	if lineOffset < 0 || offset > len(content) {
		return -1, fmt.Errorf("ToUTF16Column: offsets %v-%v outside file contents (%v)", lineOffset, offset, len(content))
	}
	start := content[lineOffset:]
	start = start[:colZero]
	return len(utf16.Encode([]rune(string(start)))) + 1, nil
}
ToUTF16Column calculates the utf16 column expressed by the point given the
supplied file contents.
This is used to convert from the native (always in bytes) column
representation and the utf16 counts used by some editors.
package span
import (
	"fmt"
	"unicode/utf16"
	"unicode/utf8"
)