OSX Unicode Special Character handling

Posted on
Thu Feb 19, 2015 3:34 am
Vangelis offline
Posts: 167
Joined: Mar 18, 2014
Location: Southampton (UK)

OSX Unicode Special Character handling

Ok, so I have an issue that is doing my head in...Hopefully, someone with some programming (OSX) knowledge can help me solve...

I am using the Cynical Network App to send a text string to a device which is expecting a certain special character as a prefix. The problem I am having is that on WinXP it works, however on OSX it doesn't (I think it has to do with the way OSX represents strings as Unicode?)

The device expects a special character 'heart symbol', which in Windows is Control-C (or Alt-3), followed by LI1234 - this works, and I can test this using telnet (to the device)

The problem I have is both in the telnet example and using Cynical Network, I am unable to represent the 'heart symbol' or Control-C. My assumption is that Win and OSX do not use the same character map (understandable), and that the 'heart symbol' under Windows can be represented as 03 in hex, so assumption is that if I send 03 in hex under OSX all will be good (the 'heart symbol' being a by-product of Windows representation of 03 in hex)

So how can I send the text string?? I have tried the following...

/03LI1234
\03LI1234
/x03LI1234
\x03LI1234
/^CLI1234
..also putting ' ' and " " quotes around them. All fail :(

Vangelis

PS - Have a question running in the Cynical forums, however wanted to run this past the OSX progammers as well

Posted on
Thu Feb 19, 2015 4:09 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: OSX Unicode Special Character handling

The Alt-keyboard codes in Windows do not always translate to actual universal character codes. The easiest way to get access to those symbols on the Mac is to use the OS X Character Viewer; this gives you a visual representation of the characters from which you can pick/drag/copy.

I believe there is a shortcut to open the character palette, but I am terrible at remembering those; I put the icon in my menu bar by going to System Preferences -> Keyboard and ticking the "Show Keyboard & Character Viewers in menu bar". (It doesn't come up in a spotlight search or I don't know what name to use to find it, which is why I put the icon up there). At any rate, I click the icon and choose Show Character Viewer from the menu.

I THINK that first heart under the Pictographs is the same as the Windows, though sometimes I have to play around to find the right symbol to match (see attachment).

There may be other ways to this as well - I'm sure there is a mapping of the Windows Alt keys to character codes somewhere, but the graphical approach is a bit easier sometimes. Note that if you need to use this in a Python script, you may want to go ahead and find the character code... but if the Cynical Network plugin will allow you to enter it directly then this may work.

Adam
Attachments
CharacterViewer.png
CharacterViewer.png (86.42 KiB) Viewed 1822 times

Posted on
Thu Feb 19, 2015 4:58 am
Vangelis offline
Posts: 167
Joined: Mar 18, 2014
Location: Southampton (UK)

Re: OSX Unicode Special Character handling

Thanks Adam...

I did try this and the Cynical Network Plugin didn't like the 'heart symbol' - suspect it is syntax checking the whole string in the Send Text field and spitting it out..

When I tried this under Telnet eg telent 192.168.1.2 1000 .... When I paste the 'heart symbol' is see a load of control chars eg b^y%o8^N ... basically garbage

Vangelis

Posted on
Thu Feb 19, 2015 5:43 am
Vangelis offline
Posts: 167
Joined: Mar 18, 2014
Location: Southampton (UK)

Re: OSX Unicode Special Character handling

Ok - Kinda fixed this last bit - Apparently telnet is not 8-bit clean by default. You need to ...

telnet > set outbinary
telnet > open 'Host-IP'

Then the 'heart symbol' is represented correctly. Now my issue is getting this into Perry's Cynical Network plugin Send Text field!

Vangelis

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests

cron