Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

iconv or xmlsimpledocument with windows-1250

0 views
Skip to first unread message

B.r.K.o.N.j.A

unread,
Aug 8, 2006, 9:10:17 AM8/8/06
to
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

ninja

unread,
Aug 9, 2006, 1:45:23 AM8/9/06
to

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

B.r.K.o.N.j.A

unread,
Aug 9, 2006, 3:53:01 AM8/9/06
to

> 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 :)))

ninja

unread,
Aug 9, 2006, 7:37:12 AM8/9/06
to

:) Yeah, I get that ... Just wanted to help, no insult intended.

B.r.K.o.N.j.A

unread,
Aug 9, 2006, 8:52:46 AM8/9/06
to

>
> :) 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.

0 new messages