Surveiller /var/log/cups/error.log
message :
E [] Unsupported character set “iso-8859-1″!
Restart samba
LANG=fr_BE.UTF-8 /etc/init.d/samba restart
Blog dans lequel je note comme aide-mémoire les trucs et astuces que j'ai utilisés pour configurer selon mes besoins mes machines sous Linux Ubuntu Raspbian Macosx Windows.
Surveiller /var/log/cups/error.log
message :
E [] Unsupported character set “iso-8859-1″!
Restart samba
LANG=fr_BE.UTF-8 /etc/init.d/samba restart
property commandString : "ssh user@host" -- < Edit this line as desired.
tell application "Terminal" -- Get a free window to run the commandString,
set windowCount to (count of the windows)
--activate
if ((count of windows) is 1) then
close window 1 -- attention, s'il n'y a qu'une seule fenêtre ouverte, elle sera fermée
--tell window 1
-- set miniaturized to true
--end tell
repeat with w from 1 to 3 -- je veux 3 connexions
tell window (windowCount + 1)
do script commandString
end tell
tell application "Terminal" to set current settings of first window to settings set 7
--settings 7 = my colors and ISO-8859-1ISO Latin-1 encoding and police 16 pt
tell front window
set zoomed to true
-- Je veux que mes 3 fenêtres soient maximizées et occupent tout l'écran
end tell
end repeat
else
repeat with w from 1 to 3
tell window (windowCount + 1)
do script commandString
end tell
tell application "Terminal" to set current settings of first window to settings set 7
tell front window
set zoomed to true
end tell
end repeat
end if
end tell
*** Autre version, avec trois fenêtres disposées 1 full screen et 2 half screen ***
pour un écran de 1680 x 1050
property commandString : "ssh meteo@mars" -- < Edit this line as desired.
tell application "Terminal" -- Get a free window to run the commandString,
set windowCount to (count of the windows)
activate
if ((count of windows) is 1) then
close window 1
--tell window 1
-- set miniaturized to true
--end tell
repeat with w from 1 to 3
tell window (windowCount + 1)
do script commandString
end tell
tell application "Terminal" to set current settings of first window to settings set 7
tell front window
if w is 1 then
set zoomed to true
else
if w is 2 then
set position to {20, 22}
set size to {825, 960}
--properties
--tell application "Terminal" to set bounds of first window to {0, 0, 820, 975}
else
set position to {850, 22}
set size to {825, 960}
--properties
--tell application "Terminal" to set bounds of first window to {0, 670, 820, 975}
end if
end if
end tell
end repeat
else
repeat with w from 1 to 3
tell window (windowCount + 1)
do script commandString
end tell
tell application "Terminal" to set current settings of first window to settings set 7
tell front window
if w is 1 then
set zoomed to true
else
if w is 2 then
set position to {20, 22}
set size to {825, 960}
--properties
--tell application "Terminal" to set bounds of first window to {0, 0, 820, 975}
else
set position to {850, 22}
set size to {825, 960}
--properties
--tell application "Terminal" to set bounds of first window to {0, 670, 820, 975}
end if
end if
end tell
end repeat
end if
end tell
Pour pouvoir imprimer des textes non encodés en UTF-8 avec cups et le filter texttops
Il faut wrapper texttops dans ce genre de script qui se charge de faire la conversion de codage
http://www.srz.de/Members/bla/cups/filter/texttops%20wrapper/texttops
#!/usr/bin/perl -w
# texttops.pl wrapper script for the texttops filter
# ====================================================
# COpyright (C) 2007 Helge Blischke <h.blischke@acm.org>
#
# 1.00 - 2007-12-29/Bl
# initial implementation
# 1.01 - 2007-12-31/Bl
# Options and sugaring
#
# Description:
# ------------
# This script tries to determine the characterset used,
# decodes the input to the internal UTF-8 and writes
# the UTF-8 data to the original texttops filter.
use Encode;
use Encode::Guess;
#
# Configuration data, edit as needed
# -------------------------------------------------------------------------------
$texttops = $ENV{CUPS_SERVERBIN} . '/filter/orig.texttops';
@suspects = qw(iso-8859-15 iso-8859-1); # to try one by one
# -------------------------------------------------------------------------------
if (scalar @ARGV == 0)
{
die "Usage: texttops.pl jobid username title copies options [file]\n";
}
#
# Get the command line parameters
#
$jobid = $username = $title = $copies = undef;
$jobid = shift; # Job ID
$username = shift; # Job requesting user name
$title = shift; # Job title
$copies = shift; # Number of requested copies
$options = shift; # Textual representation of job attributes
$textfile = shift; # Pathname of input text file
#
# Determine from where to read
#
if (defined $textfile)
{
open (FILI, "<:raw", "$textfile") || die "ERROR: $textfile: $!\n";
}
else
{
open (FILI, "<:raw", "&STDIN") || die "ERROR: STDIN: $!\n";
}
#
# First, check the command line options
#
@opts = split (/\s+/, $options);
$charset = undef;
$buffer = undef;
foreach my $opt (@opts)
{
if ($opt =~ /encoding=(\S+)/)
{
$charset = $1;
#$charset =~ tr/A-Z/a-z/; # make lower case
if ($charset =~ /^lang/) # language
{
eval
{
require I18N::Langinfo;
I18N::Langinfo->import(qw(langinfo CODESET));
$charset = langinfo (CODESET ());
};
die "ERROR: $@\n" if ($@); # undefined language
}
else
{
$codec = find_encoding ($charset);
die "ERROR: $charset is not a valid encoding name: $codec\n" unless ref $codec;
}
warn "NOTICE: characterset = $charset\n";
last;
}
}
if (! defined $charset)
{
#
# Read the first buffer and determine the encoding
#
$buffer = '';
$codec = '';
$bytes = read (FILI, $buffer, 16384) || die "ERROR: read input: $!\n";
foreach my $name (@suspects)
{
my $temp = find_encoding ($name);
if (! ref $temp)
{
warn "ERROR: Unknown encoding $name\n";
next;
}
Encode::Guess->set_suspects($name);
$codec = guess_encoding ($buffer);
last if (ref $codec);
warn "NOTICE: $coded\n";
}
ref ($codec) || die "ERROR: Cannot guess: $codec\n";
$charset = $codec->name; # charset name
warn "NOTICE: guessed characterset = $charset\n";
}
#
# Set locale params fore the original texttops filter
#
$language = $ENV{LANG};
$lc_all = $ENV{LC_ALL};
$lc_all = $language if (! defined $lc_all);
$ENV{LC_ALL} = $lc_all;
#
# Open the pipe to the original filter
#
open (FILO, "|$texttops $jobid $username \'$title\' $copies \"$options\"")
|| die "ERROR: Cannot launch original filter: $!\n";
binmode (FILO, ":utf8"); # mark output as UTF-8
if (defined $charset)
{
if (defined $buffer)
{
my $outbuf = $codec->decode ($buffer); # decode the first input buffer
print FILO $outbuf;
}
binmode (FILI, ":encoding($charset)");
}
#
# Now copy the rest of the input over to the original filter
#
while (($bytes = read (FILI, $buffer, 16384)) > 0)
{
print FILO $buffer;
}
close (FILI);
close (FILO);
exit 0;