Re: russian text; perl NEED HELP!!!

1998-12-17 Thread Mirek Kwasniak
On Sun, Dec 13, 1998 at 11:05:07PM +0400, Eugene Sevinian wrote:
 Hi,
 as I run into this problem and do not how to cope with it,
 I would like to ask somebody who is workig with russian
 just to test whether perl supports sorting  of russian texts. 
 Torsten sent me a simple script which was working for him. 

Hi

Locales are working. You must check your enviroment variables. All is
manuals (for locales and perl). I attached a simple bash script to help you.
I tested it with empty, C, pl_PL and ru_RU values for LANG, LC_ALL and
LC_COLLATE variables ( 4^3 cases ).

Mirek

PS

ru_RU locale has KOI8-R encoding (collating) not iso-8859-5.

#!/bin/bash

if [ -n $LC_ALL ] ; then 

  collating=$LC_ALL

elif [ -n $LC_COLLATE ] ; then 

  collating=$LC_COLLATE

elif [ -n $LANG ] ; then 

  collating=$LANG

else

  collating=C

fi

echo Actual collating is $collating


russian text; perl NEED HELP!!!

1998-12-13 Thread Eugene Sevinian
Hi,
as I run into this problem and do not how to cope with it,
I would like to ask somebody who is workig with russian
just to test whether perl supports sorting  of russian texts. 
Torsten sent me a simple script which was working for him. 

Any help will be greatly appreciated,
TIA,
Eugene

On Sat, 12 Dec 1998, Eugene Sevinian wrote:

 
 Hi all, 
 about one month ago there were posting about locale's usage under
 perl.  I tried to use it for sorting russian, but it did not work for me.
 Is there any additional tricks beside setting LANG=ru_RU; export LANG? I
 used /usr/share/keytables/ru.map for inputing some russian text. Hope this
 corresponds to koi8 coding. 
 
 Thanks forward,
   Eugene.
 
 On 20 Nov 1998, Torsten Hilbrich wrote:
 
  
  I tried it with the following little sorting program:
  
use locale;
  
my @ARRAY;
my $i;
  
while() {
  push @ARRAY, $_;
}
for $i (sort @ARRAY) {
  print $i;
}
  
  and it work perfectly (in my case treating รถ like o).  At least perl
  is aware of locales.
  
  Torsten