Modify

Opened 10 years ago

Closed 10 years ago

#2843 closed Bug (Fixed)

_ReplaceStringInFile help file

Reported by: ffdshow Owned by:
Milestone: Component: Documentation
Version: 3.3.12.0 Severity: None
Keywords: Cc:

Description

Hello,
In the help file, should be written that files encoding in Unicode (UTF-16 LE) can't be edited by _ReplaceStringInFile function.
I succeeded after I recoded the file from Unicode (UTF-16 LE) to ANSI.

Thanks,
ffdshow

Attachments (0)

Change History (8)

comment:1 Changed 10 years ago by jchd18

What does FileGetEncoding() return when applied to your UTF16-LE encoded file? Is it using a BOM or not?

comment:2 Changed 10 years ago by ffdshow

FileGetEncoding shows 0
Windows Notepad shows Unicode and Notepad2 shows Unicode (UTF-16 LE).
The file: http://rghost.net/57508534

comment:3 Changed 10 years ago by ffdshow

I've created a text file, added some characters, then save IT in Unicode (UTF-16 LE) mode using Notepad2. FileGetEncoding shows 0 and _ReplaceStringInFile saved the file in
Unicode (UTF-16 LE BOM). Resulted file is filled with NUL

comment:4 Changed 10 years ago by Jpm

In fact your file does not have BOM.
Jon is thinking to allow such automatic Unicode detection as for now it is not allow as doc is describing it.

comment:5 Changed 10 years ago by anonymous

The current version of AutoIt doesn't support UTF16 files without a BOM. https://www.autoitscript.com/autoit3/docs/intro/unicode.htm

If you load the file in notepad and then save it again you'll notice that it then does get a BOM and works.

I'm currently testing some extra support in an upcoming beta. A preview is at https://www.autoitscript.com/autoit3/files/beta/autoit/AutoIt3_Unicode.exe - that version seems to work with your file.

comment:6 Changed 10 years ago by anonymous

Saving the text file in Windows Notepad will add BOM, but saving in Notepad2 not.
The beta executable work.
Thanks for your support!
ffdshow

comment:7 Changed 10 years ago by Jon

Fixed in latest beta.

comment:8 Changed 10 years ago by Jon

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

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.