I was wondering if anyone else had run into this before. If someone copies characters from a Word document and then pastes into an editbox, sometimes Uniface returns an error message or it will store it as some weird character. I have seen this countless times over the decades and have always just coded it using the $format and $replace in the formatFromDisplay trigger. Has anyone else run into the same type of thing and if so, did you come up with a way to convert any CP-1252 character to a UTF-8?
Here's a quick example of how I currently resolve this on a case-by-case basis. These are the "smart" quotes that Word puts in automatically while you type. I just replace them with the standard ascii quotes.
trigger formatFromDisplay
$format = $replace($replace($format, 1, """, $tometa(34), -1), 1, """, $tometa(34), -1)
$format = $replace($replace($format, 1, """, $tometa(34), -1), 1, """, $tometa(34), -1)
Here's a similar approach in c# (link below). It's trying to convert the contents of a file whereas I would be happy with converting the contents of a single field:
Steve McGill - Ramblings about Sitecore, EXM, and more
If anyone has any ideas on this, I'd love to hear them.
Best,
Larry
------------------------------
Larry Adkins
Proware
Cincinnati OH US
------------------------------