Closed kamichidu closed 9 years ago
iconv('文化の日', 'utf8', 'cp932') returns "<95>
What is the encoding of the downloaded file?
It's "cp932". Can I check anything else?
That might be the problem. I remember that calendar.vim assumes that the response file is encoded in "utf-8". Which do you use curl or wget? If both are available, calendar.vim uses curl. The problem is that it downloads with cp932.
Maybe curl is used since I can use curl and wget, both.
I tested on Windows 7, curl (with the version following) but it downloads the events with utf-8. I think that Google Calendar api always returns the response in utf-8.
curl 7.39.0 (i386-pc-win32) libcurl/7.39.0 OpenSSL/1.0.1j zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp
smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM SSL libz
What is your curl version? Can you investigate why it downloads with cp932? Opening calendar with :Calendar -debug
keeps the response files and please check the encoding of .cache/calendar.vim/download/google_calendar_download_2014baabaa
. If it is in cp932, curl actually downloads with cp932 so it is to be blame, if it is in utf-8, calendar.vim mistakenly saves the response to cp932 and reads it assuming utf-8.
curl -version
output is pasted below, and response files have I checked response files generated by Calendar -debug
, encodings in each header are UTF-8.
curl 7.27.0 (i386-pc-win32) libcurl/7.27.0 OpenSSL/1.0.0j zlib/1.2.7 libidn/1.18 libssh2/1.4.2 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN Largefile NTLM SSL SSPI libz
I investigated a reason of this issue.
I think this issue is very rare-case, and it works correctly after I delete ~/.cache/calendar.vim/.
Ok. I close this issue. Note that holiday calendars are downloaded only once because they will rarely updated.
Thanks!
Thank you for investigation.
(This is a note for myself) This issue is caused by changing &enc; when the app writes the file and reads the file. While the external downloader saves in utf-8, writefile()
saves in &enc. This issue is actually a bug but occurs rarely. If this happens, delete the cache directory.
It's enrolled in Google Calendar as "文化の日" on Nov. 3, but "文化の日" is displayed with "<95><89>".
I use kaoriya gvim 7.4.444 under Windows 7, with set enc=utf8.