Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

Character Substitute plugin

Announcements of new plugins or updates.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo

Post Reply
dperrow
Plugin Author
Posts: 276
Joined: May 27th, 2011, 2:13 pm
Location: Stirling, Scotland

Character Substitute plugin

Post by dperrow »

Before anybody flames me for this to tell me Limbo has a very similar plugin, we couldn't find it and this was written to resolve a very particular problem.

Subst.dll
This plugin is to allow single characters to be substituted with another character. Up to 256 substitutions can be done and these are defined in a configuration file in the plugins folder called Subst.cfg. It has been used to allow the correct display of some Spanish characters. The cfg file looks like:
//
Debug=1
//
//$Chr(225) Instead of this weird symbol it should display á $Chr(157)
//$Chr(233) Instead of this weird symbol it should display é $Chr(150)
//$Chr(237) Instead of this weird symbol it should display í $Chr(163)
//$Chr(243) Instead of this weird symbol it should display ó $Chr(137)
//$Chr(250) Instead of this weird symbol it should display ú $Chr(130)
//$Chr(241) Instead of this weird symbol it should display ñ $Chr(167)
//
In=$E1
Out=$9D
In=$E9
Out=$96
In=$ED
Out=$A3
In=$F3
Out=$89
In=$FA
Out=$82
In=$F1
Out=$A7
In=$D1
Out=$A6

Debug=1 will create a log file in the Logs subdirectory called Subst.log so you can verify that the cfg file has been read correctly.
The substitutions are in pairs of In and Out hex values.
The file needs a blank line at the end or the last value won’t work. The dll is called by:

$dll(Subst,1,text_to_convert,)

e.g: $dll(Subst,1,($Rss(http://www.telam.com.ar/rss2/ultimasnoticias.xml,b,1,)),)
Subst.zip
You do not have the required permissions to view the files attached to this post.

trihy
Posts: 100
Joined: January 17th, 2018, 1:43 pm

Re: Character Substitute plugin

Post by trihy »

I tried other lcd screens. And seems every vendor do what they want with the ascii code. Nobody follow the proper table. And there are many variations. Some symbols could match, others dont.

So, check if your wrong characters correspond to those ones.

It works good on winstar lcd displays. And all that uses the same ascii table.

If you have another one, try to find the ascii code for your proper characters. I did mostly with trial and error using $Chr(xx) just find the ascii for the wrong character and the ascii for the right character.

@dperrow. I just add some //// to the end of the file. It will prevent the need for a blank space and avoid confusion.

It could have something like ///end of file dont delete

Post Reply