Re[4]: [PHP] ANSI to ISO-8859-2

2008-09-23 Thread Bc. Radek Krejca
Hi,

this is working but I would like better solution:

function Decode_String($text)
{
$from = Array(#xC1;, #xE1;, #x10C;, #x10D;, #x10E;, #x10F;, 
#xC9;, #xE9;, #x11A;, #x11B;, #xCD;, #xED;, #x147;, 
#x148;, #xD3;, #xF3;, #x158;, #x159;,#x160;, #x161;, 
#x164;, #x165;, #xDA;, #xFA;, #x16E;, #x16F;, #xDD;, 
#xFD;, #x17D;, #x17E;);
$to = Array(Á, á, Č, č, Ď, ď, É, é, Ě, ě, Í, í, Ň, 
ň, Ó, ó, Ř, ř, Š, š, Ť, ť, Ú, ú, Ů, ů, Ý, ý, Ž, 
ž);
return str_replace($from, $to, $text);
}

I have php 4.4.8 and this is emergency soulution because I have
presentation today. After it I can investigate where problem is.

Thank you
Radek



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



Re[2]: [PHP] ANSI to ISO-8859-2

2008-09-22 Thread Bc. Radek Krejca
PJ ANSI is not a character set, it's a standards organisation.  You may
PJ have meant ASCII, and the string does look as if it could be ASCII. 
PJ The sequences like #xNNN are HTML-style symbolic entities.  Take a
PJ look at htmlentities().

This function encode strings, but I tried html_entity_decode, but
withut success. So I have to make conversion table with all
characters :-(.

-- 
S pozdravem,
 Bc. Radek Krejca
 ICQ: 65895541



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



Re: Re[2]: [PHP] ANSI to ISO-8859-2

2008-09-22 Thread Per Jessen
Bc. Radek Krejca wrote:

 PJ ANSI is not a character set, it's a standards organisation.  You
 may PJ have meant ASCII, and the string does look as if it could be
 ASCII.
 PJ The sequences like #xNNN are HTML-style symbolic entities.  Take
 a PJ look at htmlentities().
 
 This function encode strings, but I tried html_entity_decode, but
 withut success. So I have to make conversion table with all
 characters :-(.
 

Well, that's your choice, but I think I would investigate why
html_entity_decode() didn't work.  Maybe also take a look at the
syntactical definition of the string you're parsing - is it supposed to
have embedded html symbolic entities?


/Per Jessen, Zürich


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



[PHP] ANSI to ISO-8859-2

2008-09-19 Thread Bc. Radek Krejca
Hello,

  I get from webservice strings like this:

  #x10C;esko anglick#xE9; gymn#xE1;zium

  I think, that is ANSI, but how to convert it to something else (the
  best is iso-8859-2). I am trying iconv function, but ANSI parameter
  is not supported.

  Thank you
  Radek

-- 
Regards,
 Bc. Radek Krejca
 ICQ: 65895541 



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



Re: [PHP] ANSI to ISO-8859-2

2008-09-19 Thread Per Jessen
Bc. Radek Krejca wrote:

 Hello,
 
   I get from webservice strings like this:
 
   #x10C;esko anglick#xE9; gymn#xE1;zium
 
   I think, that is ANSI, but how to convert it to something else (the
   best is iso-8859-2). I am trying iconv function, but ANSI parameter
   is not supported.

ANSI is not a character set, it's a standards organisation.  You may
have meant ASCII, and the string does look as if it could be ASCII. 
The sequences like #xNNN are HTML-style symbolic entities.  Take a
look at htmlentities().


/Per Jessen, Zürich


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



Re[2]: [PHP] ANSI to ISO-8859-2

2008-09-19 Thread Bc. Radek Krejca
Hello,

PJ ANSI is not a character set, it's a standards organisation.  You may
PJ have meant ASCII, and the string does look as if it could be ASCII. 
PJ The sequences like #xNNN are HTML-style symbolic entities.  Take a
PJ look at htmlentities().

Yes, youre right, my mistake, of course that ASCII. I go try you hint
and I will write result.

Thank you, Radek

-- 
S pozdravem,
 Bc. Radek Krejca
 ICQ: 65895541



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



Re: [PHP] ANSI to ISO-8859-2

2008-09-19 Thread Robert Cummings
On Fri, 2008-09-19 at 09:39 +0200, Per Jessen wrote:
 Bc. Radek Krejca wrote:
 
  Hello,
  
I get from webservice strings like this:
  
#x10C;esko anglick#xE9; gymn#xE1;zium
  
I think, that is ANSI, but how to convert it to something else (the
best is iso-8859-2). I am trying iconv function, but ANSI parameter
is not supported.
 
 ANSI is not a character set, it's a standards organisation.  You may
 have meant ASCII, and the string does look as if it could be ASCII. 
 The sequences like #xNNN are HTML-style symbolic entities.  Take a
 look at htmlentities().

http://en.wikipedia.org/wiki/ANSI_art

You may be too young to have known ;)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] ANSI to ISO-8859-2

2008-09-19 Thread Per Jessen
Robert Cummings wrote:

 On Fri, 2008-09-19 at 09:39 +0200, Per Jessen wrote:
 Bc. Radek Krejca wrote:
 
  Hello,
  
I get from webservice strings like this:
  
#x10C;esko anglick#xE9; gymn#xE1;zium
  
I think, that is ANSI, but how to convert it to something else
(the best is iso-8859-2). I am trying iconv function, but ANSI
parameter is not supported.
 
 ANSI is not a character set, it's a standards organisation.  You may
 have meant ASCII, and the string does look as if it could be ASCII.
 The sequences like #xNNN are HTML-style symbolic entities.  Take a
 look at htmlentities().
 
 http://en.wikipedia.org/wiki/ANSI_art
 
 You may be too young to have known ;)

I'm 43 - but I never really got much into the BBS world.  I think I
first encountered ANSI escape sequences on DEC VT100 terminals sometime
in the mid-80s.  I've even still got a working VT100 somewhere :-)


/Per Jessen, Zürich


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