Odd characters in edit or static controls

I am trying to parse latitude/longitude metadata into Degrees, Minutes and Seconds which is all going swimmingly well. :slight_smile:

The edit or static controls don't cope with odd characters like: °. Resulting in this:
latitude (Note the character between the 8 and the °).

Any thoughts please?

That looks like an encoding issue, like UTF-8 has been converted to UTF-16 wrongly somewhere. Is that a symbol that's being inserted by the script itself, or one you're typing/pasting?

I just copied it from the charmap program and pasted it into the script as follows:

dlg.Control("editLatitude").value = degrees + "° " + minutes + "' " + seconds + "\" " + direction;

Using DOpus.Output - the 'degrees' variable is fine right up until the above line. If I remove the ° then it's ok too.

If it's a script add-in, make sure the script text file is saved as UTF-8 with BOM. Most editors have an option for the encoding in the Save As dialog, as a dropdown.

Or is it in a button?

1 Like

Thanks as always Leo. It was VS Code saving as UTF8 only.

1 Like

Click "UTF-8" on the status bar

1 Like