Modify

Opened 16 years ago

Closed 16 years ago

#454 closed Feature Request (Completed)

FileRead handle files as UTF-8 even BOM is missing

Reported by: Nitrogen Owned by:
Milestone: 3.2.13.8 Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

I have many UTF-8 file without BOM. When I tried to open files using the UTF-8 flag and use fileread to read the content, however, fileread is TOO SMART and treat it as ANSI.

I suggest
if using fileread to read a file directly
(ie FileRead(FileName, length),
fileread can determine filetype using BOM automatically.

if using fileread to read an opened file
(ie FileRead(FileHandle, length) ),
fileread will follow the filemode assigned in FileOpen.

Thanks!

Attachments (0)

Change History (5)

comment:1 Changed 16 years ago by TicketCleanup

  • Version 3.2.12.0 deleted

Automatic ticket cleanup.

comment:2 Changed 16 years ago by Valik

  • Summary changed from [Feature Req] FileRead handle files as UTF-8 even BOM is missing to FileRead handle files as UTF-8 even BOM is missing

It's not necessary to put a tag describing the type of ticket in the title given there's a field for inputting that information...

comment:3 Changed 16 years ago by Valik

  • Resolution set to Rejected
  • Status changed from new to closed

I don't know what your expectations are. UTF-8 files don't need a BOM because it's pretty much pointless for the encoding so the comment on it being missing is irrelevant. As for the behavior, UTF-8 is fully backwards compatible with ANSI so if your file contains all ANSI characters it's going to be treated as ANSI, BOM or not.

If there was a problem with the behavior here it would actually be bug and not a feature request. Since nobody else has clearly demonstrated any issue I'm closing this as rejected.

comment:4 Changed 16 years ago by Valik

  • Resolution Rejected deleted
  • Status changed from closed to reopened

Alright, somebody actually gave me a file which demonstrated the problem and the desired outcome and I now see what the OP means. Would have been helpful to have that from the start, however.

comment:5 Changed 16 years ago by Jpm

  • Milestone set to 3.2.13.8
  • Resolution set to Completed
  • Status changed from reopened to closed

$FO_UTF8 will work for opening in read mode

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

Action
as closed The ticket will remain with no owner.
Author


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

 
Note: See TracTickets for help on using tickets.