Connecting Tech Pros Worldwide Help | Site Map

iconv or xmlsimpledocument with windows-1250

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 8th, 2006, 01:05 PM
B.r.K.o.N.j.A
Guest
 
Posts: n/a
Default iconv or xmlsimpledocument with windows-1250

Does anyone has any experience with these two, I've lost a s**tload of
time trying to make them work with a well formed xml document encoded in
windows-1250 encoding, but simplexml works only with utf-8 and
iso-8859-1 and iconv-ing the string with original xml in it
($isostr=iconv('WINDOWS-1250', 'ISO-8859-1', $winstr);) before xml
parsing did no good (illegal characters, which i could //IGNORE or
//TRANSLIT but then I would loose characters that I needed in a first
place). Finally I ended up writing my own parsing routine for that
particular xml file. Damn, and I hoped that I could use these cool new
xml parsing capabilities that were so hyped in php5 (the language in
question is php 5.0.4)

Any ideas?
--

B.r.K.o.N.j.A = Bionic Robotic Knight Optimized for Nocturnal Judo and
Assasination

  #2  
Old August 9th, 2006, 05:35 AM
ninja
Guest
 
Posts: n/a
Default Re: iconv or xmlsimpledocument with windows-1250


B.r.K.o.N.j.A wrote:
Quote:
Does anyone has any experience with these two, I've lost a s**tload of
time trying to make them work with a well formed xml document encoded in
windows-1250 encoding, but simplexml works only with utf-8 and
iso-8859-1 and iconv-ing the string with original xml in it
($isostr=iconv('WINDOWS-1250', 'ISO-8859-1', $winstr);) before xml
parsing did no good (illegal characters, which i could //IGNORE or
//TRANSLIT but then I would loose characters that I needed in a first
place). Finally I ended up writing my own parsing routine for that
particular xml file. Damn, and I hoped that I could use these cool new
xml parsing capabilities that were so hyped in php5 (the language in
question is php 5.0.4)
>
Any ideas?
--
>
B.r.K.o.N.j.A = Bionic Robotic Knight Optimized for Nocturnal Judo and
Assasination
Hello,

As far as I can tell from your post, it seems you're converting to
wrong charset. ISO-8859-1 (Latin-1) can't handle the characters you
need - my guess is that you need Serbian latin. Try iconv- ing the
string to UTF-8.

Vladislav

  #3  
Old August 9th, 2006, 07:45 AM
B.r.K.o.N.j.A
Guest
 
Posts: n/a
Default Re: iconv or xmlsimpledocument with windows-1250

Quote:
Hello,
>
As far as I can tell from your post, it seems you're converting to
wrong charset. ISO-8859-1 (Latin-1) can't handle the characters you
need - my guess is that you need Serbian latin. Try iconv- ing the
string to UTF-8.
>
Vladislav
>
Allready did that and it worked fine as expected (WIN-1250 -ISO-8859-1
was a gross oversight on my part... :)) Anyway, if anyone can use this:
When simplexml-ing a xml file that's not in ISO-8859-1 or UTF-8 (and
that xml file has encoding tag within), simplexml internally converts it
to utf-8 and returns utf-8 data (which started my problem since I
believed that I'm getting win-1250 data as stated in xml document... and
things just took from there ... :))

Thx,

P.S. I was actually needin' Croatian latin (though it's *exactly* the
same as Serbian one, you wouldn't make a lot of friends here calling it
Serbian :)))

--

B.r.K.o.N.j.A = Bionic Robotic Knight Optimized for Nocturnal Judo and
Assasination
  #4  
Old August 9th, 2006, 11:35 AM
ninja
Guest
 
Posts: n/a
Default Re: iconv or xmlsimpledocument with windows-1250


B.r.K.o.N.j.A wrote:
Quote:
Quote:
Hello,

As far as I can tell from your post, it seems you're converting to
wrong charset. ISO-8859-1 (Latin-1) can't handle the characters you
need - my guess is that you need Serbian latin. Try iconv- ing the
string to UTF-8.

Vladislav
>
Allready did that and it worked fine as expected (WIN-1250 -ISO-8859-1
was a gross oversight on my part... :)) Anyway, if anyone can use this:
When simplexml-ing a xml file that's not in ISO-8859-1 or UTF-8 (and
that xml file has encoding tag within), simplexml internally converts it
to utf-8 and returns utf-8 data (which started my problem since I
believed that I'm getting win-1250 data as stated in xml document... and
things just took from there ... :))
>
Thx,
>
P.S. I was actually needin' Croatian latin (though it's *exactly* the
same as Serbian one, you wouldn't make a lot of friends here calling it
Serbian :)))
>
--
>
B.r.K.o.N.j.A = Bionic Robotic Knight Optimized for Nocturnal Judo and
Assasination
:) Yeah, I get that ... Just wanted to help, no insult intended.

  #5  
Old August 9th, 2006, 12:45 PM
B.r.K.o.N.j.A
Guest
 
Posts: n/a
Default Re: iconv or xmlsimpledocument with windows-1250

Quote:
>
:) Yeah, I get that ... Just wanted to help, no insult intended.
>
No, no, don't get me wrong, I would never take it as an insult (nor
would anyone who is not a complete idiot) :) just wanted to point out
that there are people who might begin an argument on "...how and why
it's not the same in the great scheme of things..." while the alphabet
itself (latin one) *is* letter for letter the same which would to
someone outside look really surreal. Absurd sh*t... :)

Btw, thx for the help, that would be exactly what I needed.

--

B.r.K.o.N.j.A = Bionic Robotic Knight Optimized for Nocturnal Judo and
Assasination
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.