On 03/12/15 02:22, [email protected] wrote: > On 2015-03-10 20:20, [email protected] wrote: >> Hi, >> >> I noticed that a decade ago some users detected "Wide character in >> print" messages in their mimedefang logs. >> It was supposedly fixed by adding >> >> >> export LC_ALL=C >> >> >> in the mimedefang init script. >> >> (perl unicode issue) >> >> However, my Linux distro (Gentoo) runs the following in the mimedefang >> init script: >> >> LC_ALL=C >> export LC_ALL >> >> but I'm occasionally getting the "Wide character in print" messages. >> >> I'm running v 2.75 and Perl 5.18.2. >> >> Any ideas? > > Hi again, > > Just wanted to add that I modified /usr/bin/mimedefang.pl for > debugging purposes: > > /usr/bin/mimedefang.pl: > > sub action_notify_sender ($) { > [...] > if (open(FILE, ">>NOTIFICATION")) { > <------>md_syslog('err', "action_notify_sender print FILE $msg"); > [...] > [snip...]
Assuming that the problem occurs when you're printing to FILE, you need to add the following after you open the file: binmode(FILE, ':utf8'); I'm fairly certain that LC_ALL won't have any effect on output to a file other than STDOUT/STDERR and even still, that basically forces the terminal into 7bit mode so would exacerbate the problem. binmode(<filehandle>, ':utf8') forces I/O to/from the filehandle to be in utf8 as opposed to whatever your default encoding may be. it's been a while so I'm not positive, but you may also need/benefit from 'use utf8;' ... you should check the docs for more specific details on that one. hope this helps. alan _______________________________________________ NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID. You may ignore it. Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list [email protected] http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

