Sean wrote:
I suppose the opposite. Assuming you're in the German locale, I suspect the downloaded xml file is in UTF-8, not in German codepage. MsgBox cannot display properly texts in UTF-8.
Thanks for the reply guys.
I think the msgbox thing might be the issue. However, I can't "send" the variable correctly either.. which is really restricting me...
I need to be able to send the content of the variable into a standard control somehow....
For example, try the function below, it will demonstrate my point:
Open a notepad and press f9
it will paste the text in-correctly.
>>However<<<
It used the same variable to write into lyrics.txt, if you open that, the text is displayed correctly.
e.g
text that is sent looks like this: (i.e corrupted format)
"
Sie sollen brennenSie sollen brennenIn der HölleStirbStirb, Fernseher, stirbStirb
"
The text in the lyrics.txt looks like this: (format is intact)
"
Sie sollen brennen!
Sie sollen brennen!
In der Hölle!
Stirb!
Stirb, Fernseher, stirb!
Stirb!
"
I'm running an English/us version of windows 7 and I type my text using a uk keyboard (if that makes any difference?) the website where the lyrics are downloaded from, is in English as well, i.e:
http://lyricwiki.org/Farin_Urlaub:Dusche
I tried the FileReadU, but it didn't seem to make a difference, i.e the text is read correctly, but it's not sent correctly..?
This is a "bang-head-on-Wall" type situation for me, so close to the goal but I can't quite get there... ..>??< frustrating..
---edit
I also tried:
ControlSend, RichEdit20W1, %SongLyricFinal%, 88
into the iTunes control that holds the lyrics.
But I get a mess:
N der hLle
Tirb, FErnseher, stirb
Instead of:
In der Hölle!
Stirb, Fernseher, stirb!
open note pad, and then press f9. then open the lyrics.txt in the script folder to compare.
Code:
return
f9::
;---------- download file
URLDownloadToFile,http://lyricwiki.org/Farin_Urlaub:Dusche, TEMPiTunesAutoLyricsCurrentsong.xml
Sleep 100
;----------- read xml file
FileRead, RawXMLFileVAR, TEMPiTunesAutoLyricsCurrentsong.xml
;RawXMLFileVAR := FileReadU("TEMPiTunesAutoLyricsCurrentsong.xml", ForceType="Auto: Unicode" )
;RawXMLFileVAR := FileReadU("TEMPiTunesAutoLyricsCurrentsong.xml", ForceType="Auto: UTF-8" )
;---------------- retrieve the line with the lyric
Loop, parse, RawXMLFileVAR, `n, `r ; Specifying `n prior to `r allows both Windows and Unix files to be parsed.
{
FailedString = There is currently no text in this page
IfInString, A_LoopField,%FailedString%
{
qtt(":-(")
Return
}
IfInString, A_LoopField,class`='lyricbox' ;note I'm escaping the equal sign.
RawLineWithSongLyric = %A_LoopField%
}
;---------------------- format it correctly.
Needle = class`='lyricbox'
PositionOfNeedle := InStr(RawLineWithSongLyric, Needle)
FinalPositionOfNeedle := (PositionOfNeedle + 17)
StringTrimLeft, RawlineMinusStuffAtTheBeggining, RawLineWithSongLyric, %FinalPositionOfNeedle%
StringReplace, SongLyricFinal, RawlineMinusStuffAtTheBeggining, <br />, `n, All
;--------------->>>>>>>>>>>. THE OUT PUT PART<<<<<<<<<<<<<<<<<<<<<<,
FileAppend, %SongLyricFinal%, Lyrics.txt
Clipboard = %SongLyricFinal%
send, %SongLyricFinal%
;msgbox, %SongLyricFinal%