Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58894 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45648 invoked from network); 12 Mar 2012 21:26:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2012 21:26:45 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:62295] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/76-13375-41A6E5F4 for ; Mon, 12 Mar 2012 16:26:45 -0500 Received: by werh12 with SMTP id h12so4515435wer.29 for ; Mon, 12 Mar 2012 14:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=ncnRZVfabfNiTskfeMZ8xonA43F8N2ijVDhNp02x1ps=; b=uanApDgxdmxhHyUNH/AwulwrmAAc5ohrOGif0S80BQxpJBtItQQLBJ5AqEdmERDyOy sobdno9fOJizyBCsuRa4Nc9j7OEQRwINbjDYK/gMeD5W9k1lwzaaLOPmLJXmNvB/7ArU esWprvOwVcISFOVDXSpFBVysN4JH7DnCbNTv65npou29TMfnlFy19enXI4lZ3pLm2q1G AQmWfNiYhN+ATd72lKD14SNlxq+C4rQHQglJluvFAXxEUnitS1CbWHBzncIdRcNC298c FvLyYGBcfuS+cUnSN3buaTdmhPLYKAOh7opELVIuofG8TUfjeCAAPs5eF43vWM5gkB0q 2EtQ== Received: by 10.180.8.164 with SMTP id s4mr1397162wia.6.1331587601695; Mon, 12 Mar 2012 14:26:41 -0700 (PDT) Received: from [192.168.1.26] (60.Red-83-41-228.dynamicIP.rima-tde.net. [83.41.228.60]) by mx.google.com with ESMTPS id k6sm13590562wie.9.2012.03.12.14.26.38 (version=SSLv3 cipher=OTHER); Mon, 12 Mar 2012 14:26:40 -0700 (PDT) Message-ID: <4F5E6A0C.90507@gmail.com> Date: Mon, 12 Mar 2012 22:26:36 +0100 User-Agent: Thunderbird MIME-Version: 1.0 To: Stas Malyshev CC: Rasmus Lerdorf , PHP internals References: <4F5D9C77.3030000@lerdorf.com> <4F5DA152.10109@sugarcrm.com> <4F5DA894.8060606@lerdorf.com> <4F5DAB49.3030808@sugarcrm.com> <4F5DAFCE.8020600@lerdorf.com> <4F5E5148.4030106@sugarcrm.com> <4F5E5219.7080501@lerdorf.com> <4F5E53C3.8060502@sugarcrm.com> In-Reply-To: <4F5E53C3.8060502@sugarcrm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] default charset confusion From: keisial@gmail.com (=?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?=) On 12/03/12 20:51, Stas Malyshev wrote: > Hi! > >> But you can't necessarily hardcode the encoding if you are writing >> portable code. That's a bit like hardcoding a timezone. In order to >> write portable code you need to give people the ability to localize it. > > No, it's not like timezone at all. I have to support all timezones in > a global app, but I don't have to internally support every encoding on > Earth - having everything internally in UTF-8 works quite well, and a > lot of applications do exactly that - they have everything internally > in UTF-8 and only may convert when importing or exporting the data. I > don't see anything in using UTF-8 throughout the app/library that > makes it non-portable. However, if we allow to change defaults in > htmlspecialchars() etc. that essentially makes having defaults useless > as I'd have so explicitly specify UTF-8 each time - otherwise it's a > gamble what encoding I'd actually get. If you are a framework developer, and really want to shield against a bad php.ini setting, you could ini_set() to your prefered charset at the beginning of the request.