View Single Post
Old 03-17-2025, 10:45 AM   #14
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 1,029
Karma: 2003162
Join Date: Jun 2011
Device: PC, t1, t2, t3, Clara BW, Clara HD, Libra 2, Libra Color, Nxtpaper 11
Quote:
Originally Posted by Comfy.n View Post
I saw your template that checks if there are non-ascii characters in a title and it works just fine! Now I've saved it and tagged it with 'transliterate' and 'Terisa'.
Yes, it is a nice check: well found . However, I do also have sub-titles, so I had to rework the template a little bit.
Code:
program:
	if (field('title')!=transliterate(field('title')))
	then
		if (field('#subtitle')!=transliterate(field('#subtitle')))
		then
			'true1, true2'
		else
			'true1'
		fi
	else
		if (field('#subtitle')!=transliterate(field('#subtitle')))
		then
			'true2'
		else
			'false'
		fi
	fi
It returns true1 for title, true2 for subtitle, or false when neither contains non-ASCII chars.

The reason I didn't use intermediate vars is because I noticed that the formatter stops processing/evaluating in case of a nil situation, so this seems to be fastest way to process. But as always, correct me if I'm wrong

Last edited by DrChiper; 03-17-2025 at 11:25 AM.
DrChiper is offline   Reply With Quote