# Conversion of plain text to HTML

**URL:** https://community.mp3tag.de/t/conversion-of-plain-text-to-html/8748
**Category:** Support
**Created:** [August 9, 2009, 9:34pm UTC](https://community.mp3tag.de/t/conversion-of-plain-text-to-html/8748 "2009-08-09T21:34:57Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [August 9, 2009, 9:34pm UTC](https://community.mp3tag.de/t/conversion-of-plain-text-to-html/8748/1 "2009-08-09T21:34:57Z")

</div>

Can aynone give me export script to convert ANSI ("8-bit ASCII") plain text to HTML? Thanks.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [August 10, 2009, 5:41am UTC](https://community.mp3tag.de/t/conversion-of-plain-text-to-html/8748/2 "2009-08-10T05:41:48Z")

</div>

What do you mean?  
Just encoding of entities?  
ANSI to Unicode? UTF-8859-x to UTF-8?  
Meta description?

DD.20090810.0941.CEST

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [August 10, 2009, 10:13am UTC](https://community.mp3tag.de/t/conversion-of-plain-text-to-html/8748/3 "2009-08-10T10:13:24Z")

</div>

> What do you mean?  
> Just encoding of entities?

Yes.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [August 10, 2009, 10:47am UTC](https://community.mp3tag.de/t/conversion-of-plain-text-to-html/8748/4 "2009-08-10T10:47:39Z")

</div>

To verify ... you want ...

... instead of writing "\<"  
you want to write "\<" or "\<"  
for HTML related chars

... and additionally all other special chars like  
e. g. german umlauts "ä" is "ä" or "ä"?

Why not ...

... and using the unicode char as is?

In some old export scripts (years ago long before $regexp() has become known to me) I did it the following way, but there are possibly other ways with shorter code and more generic, maybe by regexp.

```
$puts(my_NUMENTITY,$get(my_ARTIST))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),%,&#037;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),&,&#038;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),'',&#039;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),+,&#043;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),?,&#063;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),/,&#047;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),ä,&#228;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),Ä,&#196;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),ö,&#246;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),Ö,&#214;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),ü,&#252;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),Ü,&#220;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),ß,&#223;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),é,&#233;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),É,&#201;))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),ÿ,&#255;))
$puts(my_ARTIST,$get(my_NUMENTITY))

```

DD.20090810.1503.CEST

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [August 10, 2009, 6:11pm UTC](https://community.mp3tag.de/t/conversion-of-plain-text-to-html/8748/5 "2009-08-10T18:11:18Z")

</div>

> To verify ... you want ...  
> ... instead of writing "\<"  
> you want to write "\<" or "\<"  
> for HTML related chars

I want to write in my track tags e.g. **Francisco \<\> Lomuto** and I want the Export to write this into a HTML file as **Francisco \<\<Pancho\>\> Lomuto** so the browser shows the original text **Francisco \<\> Lomuto**.

Currently my Export script writes %artist% to the HTML files, producing **Francisco \<\> Lomuto** which the browser shows that as **Francisco \<\> Lomuto**. All the Export Configuration Archive HTML scripts I have looked at suffer from the same problem.

> ... and additionally all other special chars like  
> e. g. german umlauts "ä" is "ä" or "ä"?

Yes - it is a large list!

> Why not ...  
>   
> ... and using the unicode char as is?

That does not solve the problem - still the browser shows **Francisco \<\> Lomuto**.

> In some old export scripts (years ago long before $regexp() has become known to me) I  
> did it the following way, but there are possibly other ways with shorter code and more generic, maybe by regexp.

Yes, I think I will have to make a $regexp for the ANSI set... unless anyone has one they have already made??

Thanks Detlev.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [August 10, 2009, 7:02pm UTC](https://community.mp3tag.de/t/conversion-of-plain-text-to-html/8748/6 "2009-08-10T19:02:32Z")

</div>

> [@chrisjj](#):
>
> ... I want to write in my track tags e.g. **Francisco \<\> Lomuto** and I want the Export to write this into a HTML file as **Francisco \<\<Pancho\>\> Lomuto** so the browser shows the original text **Francisco \<\> Lomuto**.  
> Currently my Export script writes %artist% to the HTML files, producing **Francisco \<\> Lomuto** which the browser shows that as **Francisco \<\> Lomuto**. All the Export Configuration Archive HTML scripts I have looked at suffer from the same problem. ...

This sounds to me as if you need only to escape the four HTML owned characters:

```
Double Quote: " &quot;
Ampersand: & &amp;
Left angle bracket: < &lt;
Right angle bracket: > &gt;

```

$replace(%artist%,'\<','\<','\>','\>','&','&','"','"')

DD.20090810.2308.CEST

Edit.  
Better to use this sequence of replacements ...  
**$replace(%artist%,'&','&','\<','\<','\>','\>','"','"')**

DD.20090811.1234.CEST

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [August 10, 2009, 10:40pm UTC](https://community.mp3tag.de/t/conversion-of-plain-text-to-html/8748/7 "2009-08-10T22:40:21Z")

</div>

> This sounds to me as if you need only to escape the four HTML owned characters

Ah yes, not such a long list.

> $replace(%artist%,'\<','\<','\>','\>','&','&','"','"')

That fails - on \< and \> it replaces the replacement ampersand ! Fixed version:

$replace(%artist%,&,&,\<,\<,\>,\>,",")

Thanks Detlev.

Now I have to consider this horrible complication of all my HTML scripts ☹

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:21pm UTC](https://community.mp3tag.de/t/conversion-of-plain-text-to-html/8748/8 "2026-02-09T12:21:42Z")

</div>


