Opened 13 years ago

Closed 13 years ago

#1805 closed Bug (Fixed)

Functions that modify files should not change encoding

Reported by: PsaltyDS Owned by: Jpm
Milestone: Component: Standard UDFs
Version: Severity: None
Keywords: Cc:


Functions like _FileWriteToLine() and _ReplaceStringInFile() should not rewrite the file with default ANSI encoding, since it is trivial to get the old encoding by FileGetEncoding() first.

For example, the FileOpen() for write within _ReplaceStringInFile() should be:

    ;== Open the output file in write mode
    Local $iEncoding = FileGetEncoding($szFileName)
    Local $hWriteHandle = FileOpen($szFileName, $iEncoding + $FO_OVERWRITE)
    If $hWriteHandle = -1 Then Return SetError(2, 0, -1)

Attachments (0)

Change History (2)

comment:1 Changed 13 years ago by PsaltyDS

Forgot to note where the issue came up, for reference: FileInstall corrupts XML (changes UTF-16 encoding), by akshaymishra14.

comment:2 Changed 13 years ago by Jpm

  • Milestone set to
  • Owner changed from Gary to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [5960] in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jpm.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.