Nov 07

Working with UTF8 Encoded strings in iOS

I designed a digital audio dock for a major client. The dock accepts both 30-Pin apple devices and Lightning-connector apple devices, in other words almost all iPods, iPhones and iPads. The dock has a network interface so that it can connect to, and be controlled by, other devices, such as another iOS device. The device can get track metadata, playlists and track lists from the dock.

During testing we noticed that on occasion the track name, artist name or album name would not display correctly. For example, the soundtrack album from the film “Les Misérables” would show as “Les Mis√©tables”.

This is because the device providing the meta data is using the UTF-8 encoding mechanism to encode special characters, i.e. those outside of the usual 8-bit ascii character set.

In our code we had were receiving the 8-bit string and encoding it to an NSString like this:

_strDockAlbum = [NSString stringWithFormat:@"%s",pContents];

where pContents was a pointer to the 8-bit data buffer.

To resolve the issue was simple, thanks to the stringWithUTF8String method of the NSString class.
The code now looks like this:

_strDockAlbum = [NSString stringWithUTF8String:pContents];

Simples!

Nov 06

Microchip’s MPLAB X Gets an update. V1.95 Now available.

Microchip have released an update to their IDE, MPLAB X.
MPLAB X IDE v1.95 is available now for download from here

This seems to be a minor point release with the following main updates since v1.90

  • ICSP cable support for UNI/O
  • SQTP in Aux Memory support
  • Harmony quick start and Forum links
  • Enum label support within watch window
  • Detection of Compiler beta device support
  • Support for selection from multiple tools under MDB
  • Support for multiple instances of IPE or IDE
  • Improved Tool discovery on Windows PC’s (fixed a windows issue where tools were not always detected)
  • Break up of large arrays into 100 sub elements to improve performance in debugging and the watch window.
  • Bug Fixes

On windows MPLAB X now uses the latest Java JRE (v1.7) but on Mac OS X we are still stuck at JRE 1.6 which is a bit of an issue, because OS X will try to push the latest Jave Update to users and many of them will accept it, pushing the system up to JRE 1.7, which breaks various things in MPLAB X. Of particular concern is that one of Microchip’s flagship programmer/debuggers the ICD 3 doesn’t work when JRE 1.7 is present. If a user updates their Mac to JRE 1.7, then it’s not an easy job to revert back to 1.6.

I believe the underlying issue is that MPLAB X is built on NetBeans, and Microchip is using an older fork of NetBeans with some out of date JRE dependencies.

Let’s hope we can convince Microchip to move to being JRE 1.7 compatible pretty soon.

iOS 7 Tech Talks – Apple Developer

Aside

Guess who is not going to Apple’s Tech Talk in London this year?
Yip – I just got an email saying I wasn’t successful at getting a place this year. Places on these seminars are like hens teeth!

iOS 7 Tech Talks – Apple Developer.

Oct 25

Apples and Oranges

I Watched the Apple Keynote speech in which Tim Cook and others gushed about the latest devices and software to come from Cupertino.

There is new iPad Air, iPad Mini with retina display and, very interestingly, some more details about the new Mac Pro including for the first time, pricing. At over $3000 dollars, I don’t think I’ll be standing in line to buy one on launch day. If only….

Of course there is the release of the new Apple desktop operating system, called OS X Mavericks. I’ve been playing with Mavericks for a while, as I was lucky enough to be on the beta project, as well it being available to all registered Apple developers for a while too. Mavericks is good, but most of the big changes are under the hood. There is not much to read about the hidden changes on the Apple website, but the keynote speech (linked in the first paragraph, above) gives a few details, and the Keynote from the WWDC 2013 Developer’s conference gives a few details too.

On the surface there is some nice new touches, like iBooks and Maps updates, and better integration between apps, and of course better integration with iCloud. Simple things like ‘tags’ in the finder may not sound much, but it’s surprising how much they add to productivity. Best of all, the update to OS X Mavericks is completely free, just get it from the Mac App Store.

Speaking of ‘surfaces’ I see that Frank Shaw, VeeP Of Communications at Microsoft was none to impressed with Apple’s keynote speech. Of course not, he couldn’t see green cheese. You can read his somewhat missing the point Blog over here.

Anyway, best regards,

Kenny.

Oct 22

Update: Issues with ICD3 on Mac OS X

Just a brief update on the issue I had using ICD3 on Mac OS X.

Having removed all traces of Java 1.7 (aka JRE 7) from the Mac, the ICD3 still wouldn’t work.

I un-installed MPLAB X and re-installed it again and I’m happy to report that it is working again now.

Oct 21

Issues with ICD3 in Mac OS X

I’ve been using Microchip’s MPLAB X on Mac OS X for some time now, and really getting along nicely with it.

I use it for various projects and with a range of different hardware targets and programmers.

I’m using MPLAB X v1.90 with PicKIT2, PicKIT3 and ICD3 and until recently I’ve had little or no trouble.

Last week, however, I allowed the 2013-005 Java Software Update from Apple to install. This updated my VM from JRE 6 to JRE7 (aka Java version 1.7).

Everything seemed fine until I tried to program a device using my ICD3 debugger/programmer.

Continue reading