Sign in to follow this  
Followers 0
Adam9

InetGet not saving file properly in WinME

3 posts in this topic

I have no problems with this in WinXP, but I do on WinME.

I'm using InetGet to download an INI file to read from. I'm saving it to the temp dir. On WinME, it can't read the file properly. I opened the file in notepad and instead of normal line breaks, it shows the control character blocks.

Example:

WinXP:

Line 1

Line 2

Line 3

WinME:

Line1(BLOCK)Line2(BLOCK)Line3

It shows two control character blocks for each line. I'm assuming the first one represents \r and the second one is \n.

Any ideas on how I can fix this without coding a function to split the line on the control character blocks and inserting a @LF?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$file=Stringreplace($file,@lf,@crlf)

it might be:

$file=Stringreplace($file,@cr,@crlf)

Normally you only need one of the characters, linefeed or charagereturn. Windows prefers to have both.

a simple conversion script:

$fileN="text.ini"
$file=Fileread($fileN,Filegetsize($fileN))
$file=filereplace($file,@crlf,@lf); if it already has the right returns
$file=filereplace($file,@cr,@lf); incase they used only @cr
$file=filereplace($file,@lf,@crlf); change all line feeds to @crlf
; save the file how you like (as backup, overwrite, or?)
Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Thanks for the response. I see how that would work. I ended up running unix2dos on the server to add the extra linefeeds in so that Win9x could read it. It works now :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0