make string truncation more robust
improve width-based string truncation for search result names
Merge pull request #2868 from mtbc/trac-12494-search-table-crash

fix #12494: prevent search result table crash in Insight