Re: [ask] convert unknown Korean's string to readable string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks, Richard. It works in xterm, but it doesn't work in KDE konsole.
i don't know how to figure it out. help me

Best regards,

Marco

On Mon, Apr 22, 2013 at 9:43 AM, Richard Quadling <rquadling@xxxxxxxxx> wrote:
>
> On 18 April 2013 08:06, Morning Star <morning.star.crew@xxxxxxxxx> wrote:
>>
>> $string = \uc548\ub155\ud558\uc138\uc694
>
>
> <?php
> $string1 = '\uc548\ub155\ud558\uc138\uc694';
> $string2 = preg_replace('/\\\u([0-9a-f]+)/', '&#x$1;', $string1);
> $string3 = html_entity_decode($string2, ENT_COMPAT, 'UTF-8');
> echo
>     'Original : ', $string1, PHP_EOL,
>     'Entities : ', $string2, PHP_EOL,
>     'Decoded  : ', $string3, PHP_EOL,
>     PHP_EOL;
> ?>
>
> outputs (at least for me) ...
>
> 안녕하세요
>
> Based upon
> http://stackoverflow.com/questions/7274183/php-convert-unicode-to-character.
>
>
> Hope this helps.
>
> --
> Richard Quadling
> Twitter : @RQuadling
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux