LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   How to change character sets from iso-8859-1 to UTF-8? (http://www.linuxquestions.org/questions/slackware-14/how-to-change-character-sets-from-iso-8859-1-to-utf-8-a-648712/)

okos 06-12-2008 12:03 AM

How to change character sets from iso-8859-1 to UTF-8?
 
I would appreciate the wisdom of some many slackware experts. :D

Now for the problem.
I originally started a similar thread on the networking forum only to discover that it is an entirely different issue.

Basically, I am trying to print through the printer on my wife's xp box on our lan.
I think I have cups and samba set up correctly. However when I tried to print, the cups log shows that I got the following error:

Quote:

E [10/Jun/2008:22:09:04 -0700] CUPS-Add-Modify-Printer: Unauthorized
I [10/Jun/2008:22:09:04 -0700] Setting momhp device-uri to "smb://mom/Printer2" (was "smb://mom/Printer2".)
I [10/Jun/2008:22:09:04 -0700] Saving printers.conf...
I [10/Jun/2008:22:09:04 -0700] Printer "momhp" modified by "root".
I [10/Jun/2008:22:09:04 -0700] Saving printers.conf...
I [10/Jun/2008:22:09:04 -0700] Printer "momhp" modified by "root".
E [10/Jun/2008:22:24:01 -0700] Unsupported character set "iso-8859-1"!
E [10/Jun/2008:22:24:01 -0700] Unsupported character set "iso-8859-1"!
E [10/Jun/2008:22:24:01 -0700] Unsupported character set "iso-8859-1"!
E [10/Jun/2008:22:24:01 -0700] Unsupported character set "iso-8859-1"!
So, having searched far and wide, there seems to be a bug reported with cups. See the following links:
http://daniel.mateos.cc/
https://bugs.launchpad.net/ubuntu/+s...ys/+bug/203944

So from what I understand, there is a work around. That is to use the utf-8 character set instead of the iso-8859-1 as suggested by this link.

How do I change from iso-8859-1 to utf-8?
Is it possible to do it only in cups and samba?

shadowsnipes 06-12-2008 02:37 AM

This sounds like stuff that was posted in the CHANGES_AND_HINTS.TXT. Check this out first and let me know if it helps
Quote:

Originally Posted by CHANGES_AND_HINTS.TXT
There is a minor problem with the HPLIP and CUPS versions in Slackware 12.1;
hp-toolbox will not work unless LC_ALL is set to a UTF8 locale.
An easy workaround is to start it with "LC_ALL=$LANG.UTF8 hp-toolbox" if
you're not using a UTF8 locale. Also, your user account must be a member
of the "lp" group for hp-toolbox to work properly, and to use the scanner
portion of some (all?) HP print/scan/copy units, you'll need to be a member
of the "lp" group. This is due to the fact that hplip's udev rules set
the device with group "lp" ownership.

Add alias for hp-toolbox to either /etc/profile (system-wide) or ~/.profile (user specific)

Code:

alias hp-toolbox='LC_ALL=$LANG.UTF8 hp-toolbox'
Add user to lp group
Code:

gpasswd -a user lp
You could also look into hacking the rc scripts for cups and samba and add a LANG=en_US.UTF-8 in front of the call to /usr/sbin/cupsd, for example.

okos 06-13-2008 11:20 PM

So how would I do that for cups and samba?

Thanks

okos

shadowsnipes 06-13-2008 11:35 PM

Quote:

Originally Posted by okos (Post 3184318)
So how would I do that for cups and samba?

Thanks

okos

I have never tried this before. One way, like I said in my last post, might be to hack the init scripts. If you have cupsd called like
Code:

LANG=en_US.UTF-8 /usr/sbin/cupsd
it might do set the language. Something similar could be done for samba as well.

It would be better if you could simply set this in the cups and samba configs, however.

/etc/cups/cupsd.conf, according to man cupsd.conf has
Code:

DefaultLanguage locale
that can be set.

Similarly, I would poke around man smb.conf and see what you can come up with.

okos 06-15-2008 05:48 PM

I tried googiling cups and utf-8, I found that cups can handle many different character sets but have not found anything on setting utf-8 as the default character set.


Quote:

Originally Posted by shadowsnipes (Post 3184325)
I have never tried this before. One way, like I said in my last post, might be to hack the init scripts. If you have cupsd called like
Code:

LANG=en_US.UTF-8 /usr/sbin/cupsd
it might do set the language. Something similar could be done for samba as well.

I will give it a try.


Quote:

It would be better if you could simply set this in the cups and samba configs, however.

/etc/cups/cupsd.conf, according to man cupsd.conf has
Code:

DefaultLanguage locale
that can be set.
I will give the a try also.

Quote:

Similarly, I would poke around man smb.conf and see what you can come up with.
man smb.conf has well over 1000 lines of info.
I am not sure if I am using the command properly but I tried:
apropos utf-8 | grep samba
and
apropos utf-8 | grep smb
with zero results.

Okos

shadowsnipes 06-15-2008 08:20 PM

Quote:

Originally Posted by okos (Post 3185640)
man smb.conf has well over 1000 lines of info.
I am not sure if I am using the command properly but I tried:
apropos utf-8 | grep samba
and
apropos utf-8 | grep smb
with zero results.

Okos

When you are in the man page try typing '/', typing in 'lang' or 'utf', and then hitting ENTER. From there 'n' goes to next instance and SHIFT+'n' goes to the previous instance.

okos 06-18-2008 05:49 PM

After spending two weeks of evenings trying to resolve the problem without success, I decided just to to do a temporary work around until I am able to get a new printer for myself. :scratch:

I have xp on virtual box. VB enables you to share folders between the two os. I am easily able to move the doc from slack to xp to print on wife's printer through lan. That was a mouth full of words!

However, I did learn something crucial. In the past I could not get the HP toolbox to work. There was no one added to the lp group. I add myself to lp and now it works ;)


Thanks for your help.
okos

janve 06-26-2008 02:27 PM

Thanks shadowsnipes,

modifying the rc.samba and rc.cups scripts to tell the daemons
LANG=en_US.UTF-8 /usr/sbin/smbd -D and
LANG=en_US.UTF-8 /usr/sbin/cupsd, respectively, worked for me.
I do not use the HP toolbox, so I can't comment on that.

janve

shadowsnipes 06-26-2008 03:18 PM

Quote:

Originally Posted by janve (Post 3196098)
Thanks shadowsnipes,

modifying the rc.samba and rc.cups scripts to tell the daemons
LANG=en_US.UTF-8 /usr/sbin/smbd -D and
LANG=en_US.UTF-8 /usr/sbin/cupsd, respectively, worked for me.
I do not use the HP toolbox, so I can't comment on that.

janve

Glad to know it worked! :)


All times are GMT -5. The time now is 10:26 PM.