getEncodingSync error.
lethee opened this issue · comments
Docpad's articles written in Korean with UTF-8 encoding may be detected as 'binary' in balUtilPaths.getEncodingSync function.
I think the 'chunkBegin' position value of mid-chunk or last-chunk is not fit to Korean. (It uses 3 bytes for a character for Korean in utf-8)
I use modified docpad source (parseData in file.coffee) myself but I try to find solution for this problem.
if data instanceof Buffer encoding = balUtil.getEncodingSync(data) if this.get('fullPath').substr(this.get('fullPath').length-3) in ['.md', 'tml', 'htm'] encoding = 'utf8'
I'm now checking this problem occurred only for me. (Mac 10.8, en_US.UTF-8 locale)
I update docpad (models/file.coffee)