Tinderbox Forum

Exporting html title with unicode characters


(Talal) #1

I am trying to use the Export as HTML to produce plain text files. The titles of my notes have unicode characters in their titles, and I’d like these characters to remain in the names of the files produced. What is happening, however, is that the characters are simply being stripped out.

I’ve hunted around on the forum (including the old one), as I imagine this has something to do with “web safety” when exporting as HTML, but couldn’t find a solution.

Is there some way to override this default setting in TBX, using some attribute setting or otherwise?


(Mark Anderson) #2

If your template use ^title^ to export $Name, HTML-encoding will occur. Use ^value($Name)^ instead and you will get the literal value of that attribute. Similarly, instead of ^text^ use ^text(plain)^ or ^value($Name)^ - though note that any export code inline in $Text will not be evaluated.

More on ^value()^.


(Talal) #3

Thanks, Mark. Just in case I wasn’t clear, though: I am not speaking about anything in the body of the exported note: I am talking about the very filename of the resulting .txt file. So while I expect “Møḥsin.txt”, I instead get “M sin.txt” (missing the ø and the ḥ). I don’t see how to implement what you mention in regards to the filename.


(eastgate) #4

You can’t adapt the filename; back in the day, lots of people used file systems that couldn’t handle non-ASCII file names, and we wanted to be ultra-conservative about that. It’s likely to change in Tinderbox 8.


(Talal) #5

Thank you, Mark. That’s unfortunate for my immediate purposes, but I look forward then to v8.

In the meantime I have figured out a hack (though I’d be grateful for any warnings of unexpected consequences). I have placed the following into the edict pane of my note prototype: $HTMLExportFileName=$Name. The names now include the unicode characters when the notes are exported as HTML (which for my purposes actually end with .txt or .md extensions).