# How to convert several html files from UTF-8 to UTF-8-BOM

**URL:** <https://techcommunity.softwareag.com/t/how-to-convert-several-html-files-from-utf-8-to-utf-8-bom/241596>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Natural, Natural-on-Mainframes, Natural-on-Linux\
**Created:** [May 24, 2021, 1:41pm UTC](https://techcommunity.softwareag.com/t/how-to-convert-several-html-files-from-utf-8-to-utf-8-bom/241596 "2021-05-24T13:41:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![me.suzana](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@me.suzana](https://techcommunity.softwareag.com/u/me.suzana)\
**Post date:** [May 24, 2021, 1:41pm UTC](https://techcommunity.softwareag.com/t/how-to-convert-several-html-files-from-utf-8-to-utf-8-bom/241596/1 "2021-05-24T13:41:39Z")

</div>

Hello. I need to convert several html files , located in **C:\Folder1** from UTF-8 to UTF-8-BOM.

I had try these two variants with windows Powershell, but non of them works:

```
get-item C:\Folder1*.* | foreach-object {get-content -Encoding utf8BOM $_ | out-file ("C:\Folder1" + $_.Name) -encoding default}

```

**OR**

```
$MyPath = "C:\Folder1"
Get-ChildItem -Path $sourcedir -Filter *.html | ForEach-Object {

# This variable can be reused
$utf8 = New-Object System.Text.UTF8Encoding $false

$MyFile = Get-Content $MyPath -Raw
Set-Content -Value $utf8.GetBytes($MyFile) -Encoding Byte -Path $MyPath
}

```

**Does anyone know the solution?**

---

<div class="post-metadata">

**Author:** ![Eli\_Cohen1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/eli_cohen1/32/39733_2.png) [@Eli\_Cohen1](https://techcommunity.softwareag.com/u/Eli_Cohen1)\
**Post date:** [May 25, 2021, 5:47am UTC](https://techcommunity.softwareag.com/t/how-to-convert-several-html-files-from-utf-8-to-utf-8-bom/241596/2 "2021-05-25T05:47:08Z")

</div>

Hello,

This is not Adabas and Natural topic.  
Topic closed.

Eli

---

<div class="post-metadata">

**Author:** ![Eli\_Cohen1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/eli_cohen1/32/39733_2.png) [@Eli\_Cohen1](https://techcommunity.softwareag.com/u/Eli_Cohen1)\
**Post date:** [May 25, 2021, 5:47am UTC](https://techcommunity.softwareag.com/t/how-to-convert-several-html-files-from-utf-8-to-utf-8-bom/241596/3 "2021-05-25T05:47:17Z")

</div>

Closed on May 25, 2021, 5:47am UTC


