From f5_b at 163.com Tue Mar 4 09:05:06 2008 From: f5_b at 163.com (Fluid) Date: Tue Mar 4 09:05:10 2008 Subject: Why are any Chinese characters replaced with question marks in vsftpd.log? Message-ID: <000001c87dd4$c08a0a70$2a00a8c0@20080218lwf> Why are any Chinese characters replaced with question marks in vsftpd.log? (some directory names and file names have multibyte chars) Server: FreeBSD 7.0 Release minimal installed only with bin and doc installed vsftpd 2.0.5 using Release package /etc/rc.conf defaultrouter=XXX hostname=XXX ifconfig_em0=XXX inetd_enable="NO" sshd_enable="YES" Client: Windows XP sp2 Simply Chinese Edintion FTP client : Internet Explorer OR CuteFTP 8 Professional How to repeat this problem: 1. Client upload/download files(Chinese Name) to the Server 2. view /var/log/vsftpd.log in FreeBSD or Windows. The Chinese file names in vsftpd.log are replaced with question marks. If using ftpd or lukemftpd The Chinese file names in vsftpd.log can be viewed correctly. I've searched google but only get one result leaving this problem unsolved http://ubuntuforums.org/showthread.php?t=346756 --question--- How to make vsftpd.log logging Chinese file names correctly? From le_briocheur at yahoo.fr Thu Mar 6 07:29:16 2008 From: le_briocheur at yahoo.fr (chris) Date: Thu Mar 6 07:29:20 2008 Subject: convert greek chars to unicode problem (mbtowc) Message-ID: <47CF9683.9040906@yahoo.fr> Hello, i have a problem with the C code below (code + output) the goal is to convert the "PI" greek character to unicode the locale dependent representation of PI letter is byte 0xD0 (ISO 8859-7) the resulting unicode character should be 0x03A0 i dont understand why the function returns the original char without conversion... maybe someone can see what is wrong in this code ? by the way : i use a fresh 6.2 installation on i386 any help greatly welcome ! Best Regards, Chris #include #include #include #include int main( int argc, char** argv) { char mb = '\xD0'; char* loc = NULL; int i; wchar_t wc = 0; loc = setlocale( LC_CTYPE, "el_GR.ISO8859-7" ); if ( loc != NULL ) fprintf(stderr,"locale changed to %s\n",loc); else fprintf(stderr,"locale NOT changed\n"); mbtowc(0,0,0); i = mbtowc( &wc, &mb, 1 ); if ( i < 0 ) fprintf(stderr,"conversion error\n"); else fprintf(stderr,"conversion(%d) : %08x\n",i,wc ); return 0; } The OUTPUT is : locale changed to el_GR.ISO8859-7 conversion(1) : 000000d0