Opened 18 years ago
Closed 17 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 by , 18 years ago
| Version: | 3.2.12.0 |
|---|
comment:2 by , 18 years ago
| Summary: | [Feature Req] FileRead handle files as UTF-8 even BOM is missing → 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 by , 17 years ago
| Resolution: | → Rejected |
|---|---|
| Status: | new → 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 by , 17 years ago
| Resolution: | Rejected |
|---|---|
| Status: | closed → 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 by , 17 years ago
| Milestone: | → 3.2.13.8 |
|---|---|
| Resolution: | → Completed |
| Status: | reopened → closed |
$FO_UTF8 will work for opening in read mode

Automatic ticket cleanup.