Unprintable Characters


Dealing with unprintable characters is fine when you’re doing it on-purpose but, otherwise, I have just one thing to say about them.

Grrrr!

What They Are

To start with, some of you are wondering what unprintable characters are. They’re not “$&*()@@$#$” – these aren’t unprintable, they’re just unspeakable in polite company.  😉

Unprintable characters are any character that can’t be printed (or displayed). For example, a line feed character forces our text to go to the next line but you usually can’t see it. It’s usually unprintable, except for special circumstances.

Why They’re Annoying

There are times we use these characters for a variety of purposes. Sometimes, it’s to control label printing, but there are many reasons they exist and that we use them.

Other times, they occur in the most unnatural and annoying of manners.

For instance, and this is rare, but some of us have been writing some LIMS Basic and minding our own business when our LIMS Basic suddenly can’t get past the interpreter. What?!?!?! We look at it over-and-over and there’s nothing wrong with what is often a simple statement. And, then, if you get the idea to just retype it on another line and exactly as it currently is, that line works fine. Why is that? It’s because some non-printable character is in there. You can’t see it but the interpreter can and doesn’t like it. Retyping it makes a clean break of the situation.

More Recently

One of the system views I’m working with suddenly started to fail. It took me WAY too long to figure out that some of the numbers that looked like all the other numbers had some hidden characters in their text fields (yes, some systems store numbers in text fields then convert – don’t write to me to tell me it’s bad because I just work with them, not design them).

What To Do

Whenever something like this happens, you just have to spend the time to figure out where the problem came from – which tool caused it. In a big LIMS system, there are so many different tools to do the same thing that you have to see if you can narrow-down which tool tends to be used the most and focus on that. You can’t always make the issue happen, again, but you can watch for it to see if you can find a way to stop it from happening or possibly find out if there are any special circumstances (e.g., always happens to the same user with the same PC).

And, you will probably have to find some way to clean it all up, preferably with auditing turned on if you’re working in Production.

In addition, the next time it happens, maybe it won’t take you nearly as long to think to check for this (I keep telling myself this to console myself). Just remember, if it looks like a number but applying ISNUMERIC brings back a 0 (that means False), then you know something isn’t right.

Gloria Metrick
GeoMetrick Enterprises
http://www.GeoMetrick.com/


Leave a Reply

Your email address will not be published. Required fields are marked *