php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33695 localconv() returning invalid thousands_sep for France
Submitted: 2005-07-14 11:50 UTC Modified: 2005-07-14 12:42 UTC
From: tony at marston-home dot demon dot co dot uk Assigned:
Status: Not a bug Package: *Languages/Translation
PHP Version: 5.0.4 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
38 - 12 = ?
Subscribe to this entry?

 
 [2005-07-14 11:50 UTC] tony at marston-home dot demon dot co dot uk
Description:
------------
I am using the following code:

$locale = setlocale(LC_ALL, 'FRA');
$data   = localeconv();
$thousands_sep = $data['thousands_sep'];
$ascii = ord($thousands_sep);

The value in $ascii is 160 (?) when it should be 32 (space).

When I use this with number_format() the result is written to an XML file then transformed into HTML using XSL. The XSL transformation process fails because it is not valid UTF-8.



Reproduce code:
---------------
$locale = setlocale(LC_ALL, 'FRA');
$data   = localeconv();
$thousands_sep = $data['thousands_sep'];
$ascii = ord($thousands_sep);


Expected result:
----------------
ord($thousands_sep) should be 32 (space), not 160

Actual result:
--------------
ord($thousands_sep) is 160

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-14 12:42 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

If the windows locale information defines the non breaking character as the thousands_sep value - then we can\'t do anything about this. This is not a PHP bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 07:01:32 2024 UTC