X-Spam-Check-By: sourceware.org Message-ID: <4579BC2E.2020200@mail.ru> Date: Fri, 08 Dec 2006 22:25:34 +0300 From: Ruslan Fedyarov User-Agent: Mozilla Thunderbird 0.9 (X11/20041113) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Midnight Commander problem Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hi, I've experienced problem with %view{ascii} mode in Midnight Commander's bindings. I use enca-like encoding autodetector to tell w3m or another program what the correct input encoding is: View=%view{ascii} w3m -dump -I `enca`' Everything works fine in Linux, but not in Cygwin environment. In %view{ascii} mode Russian characters are shown different from normal F3 mode, capital letters are missing and lower case letters are somehow highlighted although I view usual black & white text files. I tried to experiment with F8, %view{unform} and output to another encoding, but nothing helped - either I get abracadabra or again I can't see Russian capital letters. The autodetector "enca.c" follows: #include #include char prebuf[1000]; int main(int argc, char *argv[]) { int i, c, lower, higher; if (argc>1) freopen(argv[1], "rb", stdin); i=fread(prebuf, 1, 1000, stdin); for (lower=higher=0; i>=0; i--) { c=prebuf[i]; if (c<0) c+=256; if (c>=0x80 && c<0xC0 && c!=0xA8 && c!=0xB8) { printf("cp866\n"); exit(0); } if (c>=0xE0) higher++; else if (c>=0xC0) lower++; } printf((higher>=lower)? "cp1251\n": "koi8-r\n"); return 0; } Thank you, Ruslan -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/