Помогите с локалью, плиз (linux locale)

dantess
На сайте с 06.11.2004
Offline
133
2175

Проблемы с локалью:

setlocale(LC_ALL, 'ru_RU.CP1251'); //setlocale(LC_ALL, 'ru_RU.cp1251');

echo strtoupper('Тестируем работу ЭТОГО скрипта!');

не работает - выдает: 'Тестируем работу ЭТОГО скрипта!

Прочитал кучу мануалов, но пока ничего толкового не вышло ;(

CentOS 4.4 (linux RH)

в /usr/share/locale есть

ru

ru_RU

ru_RU.CP1251

в /usr/lib/locale есть

ru_RU

ru_RU.koi8r

ru_RU.utf8

# localedef -i ru_RU -f CP1251 -c /usr/share/locale/ru_RU.CP1251

#

# locale -av | grep ru_RU

locale: ru_RU archive: /usr/lib/locale/locale-archive

locale: ru_RU.cp1251 archive: /usr/lib/locale/locale-archive

locale: ru_RU.iso88595 archive: /usr/lib/locale/locale-archive

locale: ru_RU.koi8r archive: /usr/lib/locale/locale-archive

locale: ru_RU.utf8 archive: /usr/lib/locale/locale-archive

[root@server user]# localedef -v -i ru_RU -f CP1251 -c /usr/share/locale/ru_RU.CP1251

/usr/share/i18n/locales/ru_RU:23: non-symbolic character value should not be used

/usr/share/i18n/locales/ru_RU:24: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:25: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:27: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:30: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:31: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:32: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:33: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:35: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:36: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:37: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:38: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:39: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:40: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:41: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:42: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:43: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:44: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:45: non-symbolic character value should not be used
/usr/share/i18n/locales/ru_RU:50: non-symbolic character value should not be used
/usr/share/i18n/locales/i18n:1107: non-symbolic character value should not be used
/usr/share/i18n/locales/i18n:1313: non-symbolic character value should not be used
/usr/share/i18n/locales/i18n:1345: non-symbolic character value should not be used
/usr/share/i18n/locales/i18n:1373: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:10: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:11: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:12: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:13: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:14: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:15: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:16: non-symbolic character value should not be used
/usr/share/i18n/locales/translit_neutral:17: non-symbolic character value should not be used
LC_NAME: field `name_gen' not defined
LC_NAME: field `name_mr' not defined
LC_NAME: field `name_mrs' not defined
LC_NAME: field `name_miss' not defined
LC_NAME: field `name_ms' not defined
LC_ADDRESS: field `country_name' not defined
LC_ADDRESS: field `country_post' not defined
LC_ADDRESS: field `country_car' not defined
LC_ADDRESS: field `country_isbn' not defined
LC_ADDRESS: field `lang_name' not defined
LC_ADDRESS: field `lang_term' not defined
LC_ADDRESS: field `lang_ab' not defined
LC_IDENTIFICATION: field `audience' not defined
LC_IDENTIFICATION: field `application' not defined
LC_IDENTIFICATION: field `abbreviation' not defined
LC_IDENTIFICATION: no identification for category `LC_MEASUREMENT'
LC_CTYPE: table for class "upper": 1564 bytes
LC_CTYPE: table for class "lower": 1564 bytes
LC_CTYPE: table for class "alpha": 3616 bytes
LC_CTYPE: table for class "digit": 600 bytes
LC_CTYPE: table for class "xdigit": 600 bytes
LC_CTYPE: table for class "space": 792 bytes
LC_CTYPE: table for class "print": 5144 bytes
LC_CTYPE: table for class "graph": 5144 bytes
LC_CTYPE: table for class "blank": 792 bytes
LC_CTYPE: table for class "cntrl": 664 bytes
LC_CTYPE: table for class "punct": 4120 bytes
LC_CTYPE: table for class "alnum": 3616 bytes
LC_CTYPE: table for class "combining": 2076 bytes
LC_CTYPE: table for class "combining_level3": 2076 bytes
LC_CTYPE: table for map "toupper": 14364 bytes
LC_CTYPE: table for map "tolower": 12828 bytes
LC_CTYPE: table for map "totitle": 14364 bytes
LC_CTYPE: table for width: 2968 bytes
Roxis
На сайте с 19.11.2006
Offline
40
#1

вместо LC_ALL использовать LC_CTYPE

или обновить glibc

dantess
На сайте с 06.11.2004
Offline
133
#2
Roxis:
вместо LC_ALL использовать LC_CTYPE
или обновить glibc

LC_CTYPE - не спасает.

а glibc - как правильно выбрать дистриб ?

http://ftp.gnu.org/gnu/glibc/

и как узнать текущую версию?

сорри за ламерские вопросы, но не особо силен в пингвинах ;( а рисковать не хочется - живой сервер же ;)

Roxis
На сайте с 19.11.2006
Offline
40
#3

root~# /lib/libc.so.6

GNU C Library stable release version 2.5, by Roland McGrath et al.

dantess
На сайте с 06.11.2004
Offline
133
#4
Roxis:
root~# /lib/libc.so.6
GNU C Library stable release version 2.5, by Roland McGrath et al.

Спасибо!

Осталось узнать какую из свежих версий мне ставить?

GNU C Library stable release version 2.3.4, by Roland McGrath et al.

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.4.6 20060404 (Red Hat 3.4.6-3).
Compiled on a Linux 2.4.20 system on 2006-08-12.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
linuxthreads-0.10 by Xavier Leroy
The C stubs add-on version 2.1.2.
BIND-8.2.3-T5B
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Glibc-2.0 compatibility add-on by Cristian Gafton
GNU Libidn by Simon Josefsson
libthread_db work sponsored by Alpha Processor Inc
Thread-local storage support included.
[Удален]
#5

А выбирать не приходиться ,ставь 2.5

dantess
На сайте с 06.11.2004
Offline
133
#6
artyom_korolyov:
А выбирать не приходиться ,ставь 2.5

то что 2.5 - это понятно.

вопрос в том, что там есть всякие linuxthreads , ports и пр. версии.

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий