Jump to content

InetGet not saving file properly in WinME


Recommended Posts

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?

Link to comment
Share on other sites

$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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...