# TextReplace action doesn't respect encoding of input file

**URL:** https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473
**Category:** Discussion
**Created:** [April 9, 2016, 10:17am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473 "2016-04-09T10:17:48Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![pfennig59](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e56c9b/32.png) [@pfennig59](https://www.finalbuilder.com/forums/u/pfennig59)
#### Post date: [April 9, 2016, 10:17am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473/1 "2016-04-09T10:17:48Z")

</div>

Our input files are UTF8 encoded, after running TextReplace with saving to the same file the result is UTF8 with BOM encoded.  
TextReplace should maintain the encoding of the original.

---

<div class="post-metadata">

### Author: ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)
#### Post date: [April 11, 2016, 1:43am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473/2 "2016-04-11T01:43:42Z")

</div>

In FinalBuilder v8.0.0.1618 and v7.0.0.3486 the text replace action has the ability to enable or disable “Write Byte Order Mark”. This allows for the BOM to either be written or not. If you require the BOM to not be written this option can be turned off. Please let us know ([support@finalbuilder.com](mailto:support@finalbuilder.com)) if this option is not working for files your attempting to perform text replaces on.

---

<div class="post-metadata">

### Author: ![pfennig59](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e56c9b/32.png) [@pfennig59](https://www.finalbuilder.com/forums/u/pfennig59)
#### Post date: [April 11, 2016, 10:12am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473/3 "2016-04-11T10:12:32Z")

</div>

Thank you for your reply.   
  
 We’re using FinalBuilder v8.0.0.1618, and I know the option to enable or disable _Write Byte Order Mark_ for the action _Write to Text file_.   
 I cannot find this option for _Text Replace_, though. I had looked for it, before I posted.   
  
 Anyway, after further investigation we recognized, that the initial problem happens only if the respective file is hosted on a network drive.   
  
 Best regards   
 pfennig59

---

<div class="post-metadata">

### Author: ![pfennig59](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e56c9b/32.png) [@pfennig59](https://www.finalbuilder.com/forums/u/pfennig59)
#### Post date: [April 11, 2016, 10:17am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473/4 "2016-04-11T10:17:04Z")

</div>

The network drive has Windows Server 2012, the build server Windows 10.

---

<div class="post-metadata">

### Author: ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)
#### Post date: [April 12, 2016, 1:00am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473/5 "2016-04-12T01:00:41Z")

</div>

The “Write byte order mark” appears on the details tab, under the replace options section for the Text Replace action.

---

<div class="post-metadata">

### Author: ![pfennig59](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e56c9b/32.png) [@pfennig59](https://www.finalbuilder.com/forums/u/pfennig59)
#### Post date: [April 13, 2016, 10:55am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473/6 "2016-04-13T10:55:05Z")

</div>

OK, it was my mistake to be not clear about the correct action name.   
 I’m actually talking about “Text Find / Replace”.   
 We never user the other one, because it’s deprecated.   
  
 It would be great if “Text Find / Replace” could be enhanced as well.

---

<div class="post-metadata">

### Author: ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)
#### Post date: [April 14, 2016, 5:53am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473/7 "2016-04-14T05:53:25Z")

</div>

Hi,   
  
 We have updated the action to include the writing out of the BOM. Also the action will now allow the keeping of the BOM in the original file if that is what you desire.   
  
 [http://downloads.finalbuilder.com/downloads/finalbuilder/800/FB800\_1633.exe](http://downloads.finalbuilder.com/downloads/finalbuilder/800/FB800_1633.exe)

---

<div class="post-metadata">

### Author: ![pfennig59](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e56c9b/32.png) [@pfennig59](https://www.finalbuilder.com/forums/u/pfennig59)
#### Post date: [April 14, 2016, 4:12am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473/8 "2016-04-14T04:12:35Z")

</div>

Thank you, for this fast fix.   
 This solves the issue.

---

<div class="post-metadata">

### Author: ![pfennig59](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e56c9b/32.png) [@pfennig59](https://www.finalbuilder.com/forums/u/pfennig59)
#### Post date: [May 5, 2016, 1:00am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473/9 "2016-05-05T01:00:32Z")

</div>

I just stumbled about another case, where an originally ANSI-encoded file gets converted into an UTF-8 encoded one even though the checkmark is unchecked.

---

<div class="post-metadata">

### Author: ![nevar](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/n/c4cdca/32.png) [@nevar](https://www.finalbuilder.com/forums/u/nevar)
#### Post date: [July 12, 2016, 1:18am UTC](https://www.finalbuilder.com/forums/t/textreplace-action-doesnt-respect-encoding-of-input-file/2473/10 "2016-07-12T01:18:03Z")

</div>

Does this still occur with the latest release?
