Corrupted .rmir files

This is the JP1 beginners forum. There's no such thing as a stupid question in here, so post away, but this forum is just for JP1 users and people considering JP1, non-JP1 users please use the appropriate forum above!

Moderator: Moderators

chileboy
Posts: 125
Joined: Wed Aug 26, 2020 1:04 pm
Location: NJ

Post by chileboy »

mathdon wrote:I have found the source of the problem. In your Anthem device upgrade you have a function whose name is \, the backslash character. That character has special meaning in Java strings, it is the escape character and using it as a function name on its own caused RMIR to crash.
I figured out this is because of the "trick" I was using to create empty spots on the soft key pages by using a space as a function name, as discussed in this thread. When the .rmir is saved, "name= " is replaced by "name=". From my cursory parsing of the file, RMIR appears by design to prepend the backslant to any non-alphabetic (i.e., A-Z, 0-9) character - for instance,I have an activity named "Good Night!" and in the .rmir it appears as "Good Night\!" - which I assume works fine because the backslash doesn't appear in isolation.
- Mark
The Robman
Site Owner
Posts: 21886
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post by The Robman »

Maybe an underscore (_) would be a better "space" character
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
mdavej
Expert
Posts: 4631
Joined: Wed Oct 08, 2003 7:08 am

Post by mdavej »

Here's something that just occurred to me. You could use a graphic that looks like an empty button. That way you can give your spacer function a name like "Blank" or "Null", then assign the graphic to it. I'll post a custom png file for a blank button a little later.
mdavej
Expert
Posts: 4631
Joined: Wed Oct 08, 2003 7:08 am

Post by mdavej »

Here's an image for a blank button:
http://www.hifi-remote.com/forums/dload ... e_id=26080
mathdon
Expert
Posts: 4726
Joined: Tue Jul 22, 2008 8:53 am
Location: Cambridge, UK

Post by mathdon »

chileboy wrote:I figured out this is because of the "trick" I was using to create empty spots on the soft key pages by using a space as a function name, as discussed in this thread. When the .rmir is saved, "name= " is replaced by "name=". From my cursory parsing of the file, RMIR appears by design to prepend the backslant to any non-alphabetic (i.e., A-Z, 0-9) character
I had already amended RMIR so that it would not crash when the name was a backslash (the build with this fix has not yet been posted, so you haven't missed it) ,but now I know what was intended, I have fixed it properly so that your original file now loads and shows the name of the function concerned correctly as a space. I hope to post that build shortly.

If you are interested, here is what was happening. Certain non-alphabetic characters (not all, but those that can have special significance) are prefixed by a backslash as escape character when written in a function name in a .rmir file. These include the space character, so what is actually written is backslash followed by space. But when that line in the file is read back, trailing spaces are trimmed so leaving only the backslash, which was causing the crash. I have now made a final backslash be interpreted as a space, as it can only have been produced by trimming the backslash space combination.
Graham
chileboy
Posts: 125
Joined: Wed Aug 26, 2020 1:04 pm
Location: NJ

Post by chileboy »

mdavej wrote:Here's an image for a blank button:
http://www.hifi-remote.com/forums/dload ... e_id=26080
That's more elegant than my solution, which was using ASCII 255 instead of a space. I don't have my replacement Xsight yet but I'm going to use your icon - thank you!
mathdon wrote:If you are interested, here is what was happening. Certain non-alphabetic characters (not all, but those that can have special significance) are prefixed by a backslash as escape character when written in a function name in a .rmir file. These include the space character, so what is actually written is backslash followed by space. But when that line in the file is read back, trailing spaces are trimmed so leaving only the backslash, which was causing the crash. I have now made a final backslash be interpreted as a space, as it can only have been produced by trimming the backslash space combination.
I've done a bit of programming, so I figured it was something like that. Purely out of curiosity I was going to try using a double-backslash to see if the .rmir would load properly, and the actual name then appeared as a (single) backslash.

So a trailing space in a name would now be left intact?
- Mark
mathdon
Expert
Posts: 4726
Joined: Tue Jul 22, 2008 8:53 am
Location: Cambridge, UK

Post by mathdon »

chileboy wrote:So a trailing space in a name would now be left intact?
Yes (in the next release, which is imminent). Indeed, any number of trailing spaces would be preserved.
Graham
chileboy
Posts: 125
Joined: Wed Aug 26, 2020 1:04 pm
Location: NJ

Post by chileboy »

mathdon wrote:
chileboy wrote:So a trailing space in a name would now be left intact?
Yes (in the next release, which is imminent). Indeed, any number of trailing spaces would be preserved.
Ok. Just curious. Trying to think of some practical use.
- Mark
chileboy
Posts: 125
Joined: Wed Aug 26, 2020 1:04 pm
Location: NJ

Post by chileboy »

chileboy wrote:
mdavej wrote:Here's an image for a blank button:
http://www.hifi-remote.com/forums/dload ... e_id=26080
That's more elegant than my solution, which was using ASCII 255 instead of a space. I don't have my replacement Xsight yet but I'm going to use your icon - thank you!
Received the replacement Xsight today, this works perfectly - thanks again.
- Mark
mdavej
Expert
Posts: 4631
Joined: Wed Oct 08, 2003 7:08 am

Post by mdavej »

That's great to hear.
Post Reply