Weird string operations on xbmc
#1
hallo,

while experimenting i noticed some strange behaviour of the string function on the xbmc.

i got a long string (6000 bytes or so) in html. i parsed this with the string.replace and string.find functions. e.g.:

a = string.find('<hhh>')
b = string.find('</hhh>')
text = text[:a] + text[b:]

when testing on the pc with the python interpreter it works perfect (with the import from alexpoet - great help). doing the same on the xbox doubles some tags, e.g. test outputs bring:

<h2>
<h2>
...

also text is doubled. i do not understand why it is doing that.

does anybody have any hint for me?

thanks in advance, greetings

gasgeber
Reply
#2
ugh! that's a nasty problem. i can't even imagine what caused it. good luck!
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#3
hallo,

thanks, anybody else any idea?

i try to post some more information tonight, may that can help ;(

greetings

gasgeber
Reply
#4
hi
i'm not very familiar with it but i noticed this happen when you have a cr/lf at the end of text and another cr/lf just after without any text... exemple :
Quote:<h1>(cr/lf)
(cr/lf)
<h2>(cr/lf)
result :
Quote:<h1>
<h1>
<h2>
<h2>

i thought it is related with uencode strings... maybe you should look in that way. as far as i'm concerned, i'm not good enough to say why and how to make it work...
Reply
#5
hi,

hey thanks! thats it. anytime i do something like string.replace("anything","\n\n") it doubles weird things. i have no idea why.

what i strangely do now is:

string.replace("anything","\n \n")

i put a space in between and it works just i want.

thanks and greetings

gasgeber
Reply

Logout Mark Read Team Forum Stats Members Help
Weird string operations on xbmc0