Can aynone give me export script to convert ANSI ("8-bit ASCII") plain text to HTML? Thanks.
What do you mean?
Just encoding of entities?
ANSI to Unicode? UTF-8859-x to UTF-8?
Meta description?
DD.20090810.0941.CEST
What do you mean?
Just encoding of entities?
Yes.
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),%,%))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),&,&))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),'','))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),+,+))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),?,?))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),/,/))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),ä,ä))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),Ä,Ä))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),ö,ö))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),Ö,Ö))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),ü,ü))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),Ü,Ü))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),ß,ß))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),é,é))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),É,É))
$puts(my_NUMENTITY,$replace($get(my_NUMENTITY),ÿ,ÿ))
$puts(my_ARTIST,$get(my_NUMENTITY))
DD.20090810.1503.CEST
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.
This sounds to me as if you need only to escape the four HTML owned characters:
Double Quote: " "
Ampersand: & &
Left angle bracket: < <
Right angle bracket: > >
$replace(%artist%,'<','<','>','>','&','&','"','"')
DD.20090810.2308.CEST
Edit.
Better to use this sequence of replacements ...
$replace(%artist%,'&','&','<','<','>','>','"','"')
DD.20090811.1234.CEST
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 ![]()