ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Dmitry Lebkov <dima@sakhalin.ru>
To: ALT Linux Community general discussions <community@lists.altlinux.org>
Subject: Re: [Comm] php5 LC_CTYPE strtolower
Date: Mon, 17 Nov 2008 09:25:48 +1000
Message-ID: <4920ABFC.8060002@sakhalin.ru> (raw)
In-Reply-To: <91dc8dbf0811161114n18d2e883nf3b676c3fd466768@mail.gmail.com>

Ilis пишет:
> Не работает преобразование в нижний регистр кириллицы:
> 
> putenv("LC_TIME=ru_RU.utf8");
> putenv("LC_CTYPE=ru_RU.utf8");
> $loc=setlocale(LC_TIME, null);
> print "locLC_TIME=$loc\n";
> $loc=setlocale(LC_CTYPE, null);
> print "locLC_CTYPE=$loc\n";
> print strtolower("qQrRфФяЯ")."\n";
> print strftime("%c")."\n";
> 
> ==
> 
> locLC_TIME=ru_RU.utf8
> locLC_CTYPE=ru_RU.utf8
> qqrrфФяЯ
> Пнд 17 Ноя 2008 00:04:59
> 
> ==
> 
> Почему так?

Потому, что кирилица в UTF-8 -- multibyte encoding. Подробное
описание способов объезда смотреть здесь:

http://ru2.php.net/manual/ru/book.mbstring.php

Там два способа: использовать функции mb_str* вместо str* или
включить mbstring.func_overload.

-- 
WBR, Dmitry Lebkov







  reply	other threads:[~2008-11-16 23:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-16 19:14 Ilis
2008-11-16 23:25 ` Dmitry Lebkov [this message]
2008-11-17  7:09 ` Yura Kalinichenko
2008-11-17  7:31   ` Ilis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4920ABFC.8060002@sakhalin.ru \
    --to=dima@sakhalin.ru \
    --cc=community@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git