php-general Digest 15 Apr 2013 01:33:43 -0000 Issue 8195
Topics (messages 320844 through 320847):
Currency name before and after value
320844 by: Rafnews
320845 by: Matijn Woudt
strange concatenation behavior with some currency symbols
320846 by: Rafnews
Re: [ask] convert unknown format Japanese string to readable string
320847 by: Morning Star
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Hi,
I need to manage currency display in my program.
I would like to know how can i do to detect if currency code/name should
be placed before the amount/value or after.
e.g.
USD 1234,56 / USD -1234,56
$ 1234,56 / $ - 1234,56
1234.56 EUR / -1234.56 EUR
1234.56 EUR / -1234.56 EUR
i understood that "comma" or "dot" can be found using:
setlocale(LC_MONETARY,'en_US');
but how can i know if currency needs to have currency name before or
after amount ?
thx.
A.
--- End Message ---
--- Begin Message ---
>From wikipedia:
"According to the European Union<http://en.wikipedia.org/wiki/European_Union>'s
Publication Office,[5] <http://en.wikipedia.org/wiki/ISO_4217#cite_note-5>
in English <http://en.wikipedia.org/wiki/English_language_in_England>,
Irish<http://en.wikipedia.org/wiki/Irish_language>
, Latvian <http://en.wikipedia.org/wiki/Latvian_language> and
Maltese<http://en.wikipedia.org/wiki/Maltese_language>
texts, the ISO 4217 code is followed by a fixed space and the amount:
a sum of EUR 30
In Turkish <http://en.wikipedia.org/wiki/Turkish_language>,
Bulgarian<http://en.wikipedia.org/wiki/Bulgarian_language>
, Czech <http://en.wikipedia.org/wiki/Czech_language>,
Danish<http://en.wikipedia.org/wiki/Danish_language>
, Dutch <http://en.wikipedia.org/wiki/Dutch_language>,
Estonian<http://en.wikipedia.org/wiki/Estonian_language>
, Finnish <http://en.wikipedia.org/wiki/Finnish_language>,
French<http://en.wikipedia.org/wiki/French_language>
, German <http://en.wikipedia.org/wiki/German_language>,
Greek<http://en.wikipedia.org/wiki/Greek_language>
, Hungarian <http://en.wikipedia.org/wiki/Hungarian_language>,
Italian<http://en.wikipedia.org/wiki/Italian_language>
, Lithuanian <http://en.wikipedia.org/wiki/Lithuanian_language>,
Polish<http://en.wikipedia.org/wiki/Polish_language>
, Portuguese <http://en.wikipedia.org/wiki/Portuguese_language>,
Romanian<http://en.wikipedia.org/wiki/Romanian_language>,
Sallan, Slovak <http://en.wikipedia.org/wiki/Slovak_language>,
Slovene<http://en.wikipedia.org/wiki/Slovene_language>
, Spanish <http://en.wikipedia.org/wiki/Spanish_language> and
Swedish<http://en.wikipedia.org/wiki/Swedish_language> the
order is reversed; the amount is followed by a fixed space and the ISO 4217
code:
une somme de 30 EUR"
I would say, just pick one and use it. People understand both ;)
- matijn
On Sun, Apr 14, 2013 at 8:51 AM, Rafnews <raf.n...@gmail.com> wrote:
> Hi,
>
> I need to manage currency display in my program.
> I would like to know how can i do to detect if currency code/name should
> be placed before the amount/value or after.
>
> e.g.
> USD 1234,56 / USD -1234,56
> $ 1234,56 / $ - 1234,56
>
> 1234.56 EUR / -1234.56 EUR
> 1234.56 EUR / -1234.56 EUR
>
> i understood that "comma" or "dot" can be found using:
> setlocale(LC_MONETARY,'en_US')**;
> but how can i know if currency needs to have currency name before or after
> amount ?
> thx.
>
> A.
>
--- End Message ---
--- Begin Message ---
Hi,
i almost finish my currency format displaying function, however i'm
facing a strange displaying format behavior.
here is an example in UTF-8:
1234.56 د.ج / 1234.56 DZD <-- that's wrong it should be 1234.56 د.ج
/ 1234.56 DZD
1234.56 € / 1234.56 EUR <-- that's OK
1234.56 ¥ / 1234.56 JPY <-- that's OK
1234.56 ман / 1234.56 AZN <-- That's OK
1234.56 ب.د / 1234.56 BHD <-- that's wrong
it should be 1234.56 / 1234.56 BHD
it's like for all "arabic" symbol there's a problem.
any idea how could i solved it ?
thx
--- End Message ---
--- Begin Message ---
Hi guys,
Does anyone have an idea how to solve that?
convert from Korea's encoding to utf8's encoding.
Regards,
Marco
On Sun, Apr 14, 2013 at 6:29 AM, Morning Star
<morning.star.c...@gmail.com> wrote:
> i want to try something else. korean. i got no luck when I tried with
> Korean. 'UCS-2BE' to 'UTF-8' encoding conversion didn't work. i also
> tried with ISO-2022-KR and EUC-KR to 'UTF-8' , but no luck either.
>
>
> How can I do that?
>
> Regards,
>
> Marco
>
> On Fri, Apr 12, 2013 at 8:49 AM, Morning Star
> <morning.star.c...@gmail.com> wrote:
>> It works!
>> Thanks, Koyama! :)
>>
>> On Thu, Apr 11, 2013 at 8:54 AM, KOYAMA Tetsuji <koy...@hoge.org> wrote:
>>> Hi,
>>>
>>> On Thu, Apr 11, 2013 at 5:39 PM, Morning Star
>>> <morning.star.c...@gmail.com> wrote:
>>>> Hi guys,
>>>>
>>>> i have a string like this:
>>>> $string = \u3053\u3093\u306b\u3061\u306f\u30ef\u30fc\u30c9
>>>> (Japanese words that say "hello world" in English)
>>>> How can I convert that $string to Japanese character?
>>>> It should be こんにちは世界
>>>
>>> I found tips in the stackoverflow.
>>>
>>> http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha
>>>
>>> I try it.
>>>
>>> <?php
>>> $str = "\u3053\u3093\u306b\u3061\u306f\u30ef\u30fc\u30c9";
>>>
>>> function replace_unicode_escape_sequence($match) {
>>> return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');
>>> }
>>> $str = preg_replace_callback('/\\\\u([0-9a-f]{4})/i',
>>> 'replace_unicode_escape_sequence', $str);
>>> var_dump($str);
>>>
>>>
>>> Then it displays:
>>> string(24) "こんにちはワード"
>>>
>>> regards,
>>>
>>> --
>>> KOYAMA Tetsuji
>>> koy...@hoge.org
--- End Message ---