Connecting Tech Pros Worldwide Help | Site Map

iconv or xmlsimpledocument with windows-1250

B.r.K.o.N.j.A
Guest
 
Posts: n/a
#1: Aug 8 '06
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
Guest
 
Posts: n/a
#2: Aug 9 '06

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

B.r.K.o.N.j.A
Guest
 
Posts: n/a
#3: Aug 9 '06

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
ninja
Guest
 
Posts: n/a
#4: Aug 9 '06

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.

B.r.K.o.N.j.A
Guest
 
Posts: n/a
#5: Aug 9 '06

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
Closed Thread