DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 24th November 2008
Theta Theta is offline
New User
 
Join Date: Nov 2008
Posts: 1
Thanked 0 Times in 0 Posts
Default Perl locale

Hi guys,

Whenever I run a Perl program or Perl itself, I see this warning message:
Code:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LC_CTYPE = "en_US.UTF-8",
        LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
I read through this page. “ls /usr/share/locale” does not exactly list en_US, but it does display en_US.ISO8859-1, en_US.ISO8859-15, and en_US.UTF-8. Running “env LC_ALL=en_US.UTF-8 perl” makes little difference:
Code:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = en_US.UTF-8,
        LC_CTYPE = "en_US.UTF-8",
        LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Running “env PERL_BADLANG=0 perl” does solve the problem, but I have a strong feeling that’s not the right way to go about it…
Reply With Quote
  #2   (View Single Post)  
Old 9th January 2009
ai-danno's Avatar
ai-danno ai-danno is offline
Spam Deminer
 
Join Date: May 2008
Location: Boca Raton, Florida
Posts: 284
Thanked 35 Times in 31 Posts
Default

This is just a vanilla installation of OpenBSD? I wonder if the following in your CPAN initial setup would point in the right direction-

Quote:
The next option deals with the charset your terminal supports. In
general CPAN is English speaking territory, thus the charset does not
matter much, but some of the aliens out there who upload their
software to CPAN bear names that are outside the ASCII range. If your
terminal supports UTF-8, you say no to the next question, if it
supports ISO-8859-1 (also known as LATIN1) then you say yes, and if it
supports neither nor, your answer does not matter, you will not be
able to read the names of some authors anyway. If you answer no, names
will be output in UTF-8.

Your terminal expects ISO-8859-1 (yes/no)?
__________________
Network Firefighter
Reply With Quote
  #3   (View Single Post)  
Old 9th January 2009
IIMarckus IIMarckus is offline
Port Guard
 
Join Date: Aug 2008
Posts: 13
Thanked 0 Times in 0 Posts
Default

OP here, I forgot my password last time.

The problem is that I was using UXTerm, which sets LC_CTYPE. I now instead do “xterm -en utf8”—well, actually “XTerm*locale: utf8” is in my .Xdefaults, but they’re the same thing. OpenBSD really is a learning experience

perllocale(1)
Reply With Quote
  #4   (View Single Post)  
Old 9th January 2009
lvlamb's Avatar
lvlamb lvlamb is offline
Real Name: Louis V. Lambrecht
Spam Deminer
 
Join Date: May 2008
Location: .be
Posts: 221
Thanked 25 Times in 24 Posts
Default

For one, there is no UTF-8 support at the OS level on OpenBSD.
There are UTF-8 /usr/share/locale directories which are empty, hence fallback to C, but this prevent error messages.

For the LC_ALL=C fallback, in the LInux days when they were adapting UTF-8, I used to set the environment to it.
Under OpenBSD default ksh, I often type
env LC_ALL=C [command] [arguments] which does nothing but prevent error messages.

You would set those variables in
~/.profile

Usually (other OSes), the system wide setting would happen in /etc/login.conf
but
as assumption is the mother of all f#ck-ups, checked the manpages and found no indication.
Hence, no answer. I cover my back
Also, don't su but sudo and, in the
/etc/sudoers
uncomment (visudo)
#Defaults:%wheel !env_reset
This would be OK for a one-only sysadmin system.


One of the reasons to use Xorg (/usr/X11R6/share/X11/locale) and UTF-8 aware applications.

Btw, you perfectly can save a file (OS file-system level), with UTF-8 characters in it (application level): UTF-8 aware aplications read it perfectly but the CLI will strip some characters. Just be aware that the CLI shells (OS level) will not do the translation.
Note that this also happens when the filenames have extended ASCII you would read differently under Xorg and the CLI if not set to the same locales|xlocales.

Using OpenBSD as a desktop for some years now, I don't know anymore how mendatory a full UTF-8 support from the OS level up would be vs. keeping the OS in full old plain trusted ASCII-7.
__________________
da more I know I know I know nuttin'
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
perl expression syntax qsecofr Programming 3 16th February 2009 12:56 PM
Reformatting ftp listings with awk and perl J65nko Guides 0 24th December 2008 03:04 AM
Learning Perl mtx Book reviews 7 22nd October 2008 05:55 PM
perl/tk bsdnewbie999 OpenBSD Packages and Ports 4 8th August 2008 12:34 AM
Perl Script c0mrade Programming 1 26th June 2008 05:04 AM


All times are GMT. The time now is 03:45 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick