Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85661 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65886 invoked from network); 1 Apr 2015 19:28:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Apr 2015 19:28:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.215.45 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.215.45 mail-la0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:36125] helo=mail-la0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/88-21906-1E64C155 for ; Wed, 01 Apr 2015 14:28:35 -0500 Received: by labe2 with SMTP id e2so44561761lab.3 for ; Wed, 01 Apr 2015 12:28:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=TkjLaAwt39MjRlLp7Z7Sow3vP47KXSoTBh0XM+Z6dtM=; b=mcyYaZDwwnk/TEV2ouop6n36BobQJmSiClD+nCqLWmWZaRVuNGAkPvOD4H8DvMcG/j jD3je/3WIkdrBZNc2XGhmtIJatgipi0/xpMx4x9KKc0jpvXDlLB5HmLcbD9T2P6y8p+h IlKeI2xFDzfG4jp4d1dPTALjLWMp5Q8D1QVcWEFgdryeQODSWxmwR5wMGVXzdD46Ff4C OP1j0jz+X+rg2XWJkC+7RMPr2DbHwTO/jlr2ws7D1IrHlnoMMMVhBIwmgTvVSvArTSkK 7KQvPPHKzzI2aAXVGtF4Ln9j/dX5K1N+HPoD2O9+6dtYTzktk/fwrXq3CE6Dxcqea1Av QqtA== X-Gm-Message-State: ALoCoQmf/qbEuqpToJKeVRrc09o1nS9RgSPZK8c1dxvUqIKEZPqq1FTL1r6VuEeeo62xw8i/3mCu MIME-Version: 1.0 X-Received: by 10.112.131.66 with SMTP id ok2mr36883930lbb.51.1427916510567; Wed, 01 Apr 2015 12:28:30 -0700 (PDT) Received: by 10.25.87.202 with HTTP; Wed, 1 Apr 2015 12:28:30 -0700 (PDT) X-Originating-IP: [78.144.121.114] In-Reply-To: <551C3FC4.9050109@gmail.com> References: <551C3FC4.9050109@gmail.com> Date: Wed, 1 Apr 2015 19:28:30 +0000 Message-ID: To: Stanislav Malyshev Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Deprecate setlocale? From: danack@basereality.com (Dan Ackroyd) On 1 April 2015 at 18:58, Stanislav Malyshev wrote: > Hi! Stanislav Malyshev wrote: > Library should not assume it runs in C locale, Because it is not thread-safe, it is not safe for libraries to alter the locale. I can't see any workaround to make this 'just work' - when printf cannot be relied on to work in a particular way, there is nothing the library could do to run safely. The only sensible thing a library could do in a non-C locale is to not run.....but as setlocale is not thread safe, that is not possible to detect correctly. > I don't think we should remove it. I do think we should warn people that > in this day and age, setlocale() is very bad way of doing > internationalization except for very specific cases when you know what > you are doing. Is there anything we can do that makes people more aware of it's side effects, other than to make the warning larger on the manual page? cheers Dan