#47347 [Opn->Bgs]: Feature request: add 3rd optional argument - the character encoding

From: Date: Mon, 09 Feb 2009 12:11:06 +0000
Subject: #47347 [Opn->Bgs]: Feature request: add 3rd optional argument - the character encoding
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133630@lists.php.net to get a copy of this message
 ID:          47347
 Updated by:  scottmac@php.net
 Reported By: glideraerobatics at hotmail dot com
-Status:      Open
+Status:      Bogus
 Bug Type:    JSON related
 PHP Version: 5.2.9RC1
 New Comment:

JSON is a core enabled by default module, adding something that can
encode from X to utf-8 will add a dependency and it's not always going
to know what was and wasn't intended.

Consider either using utf-8 in all of your code or base64 encode your
non unicode strings.


Previous Comments:
------------------------------------------------------------------------

[2009-02-09 11:43:16] glideraerobatics at hotmail dot com

Description:
------------
Feature request

As you can see here:
http://nl3.php.net/manual/en/function.json-encode.php
people are jumping through hoops to encode variables of non-utf8
encodings into JSON format.

Why not just centralize that magic into the function itself as a new
3rd optional argument $encoding that defaults to UTF-8?


Reproduce code:
---------------
n/a

Expected result:
----------------
n/a

Actual result:
--------------
n/a


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47347&edit=1



Thread (2 messages)

« previous php.bugs (#133630) next »