• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

OS9 Programming & UTF-8

paws

Well-known member
I'm writing my first MacOS application, a to do list, using C++ and the MacZoop framework (2.5.1, pre-Carbon) which reads and writes simple plain text files. My first language uses a few non-ASCII characters, so I'd like to keep the on-disk format as UTF-8 so I can share the files with more recent computers. I'm just drawing text with QuickDraw and I think the best bet is to transparently convert to MacOS Roman on saving and loading - I don't expect support for all of Unicode, I just want support for "basic European" at this point.

Technically I think I could hack some very simple byte replacements, but maybe there is a something like iconv already available on MacOS 9? I know the terms "MLTE" and "ATSUI" but I can't tell if they're actually available in a pre-Carbon environment, nor if they will do what I want. I'm happy to include a 3rd party library in my project if it's not too big.
 
Last edited:

paws

Well-known member
I never got around to implementing this feature, but I did find some conversion functions in Apple's headers. I was scared off by the long prototypes though, and I think they were part of ATSUI which AFAICT is OS 8.5+ only, so it wasn't perfect for my usecase (aiming for 7.5.5 compatibility).
 

cy384

Well-known member
there's an extension called "Text Encoding Converter", if you can find developer documentation somewhere it might have what you need, but likely it's utf16.
 
I’ve had some success just replacing some scalars with ascii equivalents in Swift on my proxy server, so will probably go that route since I don’t need full Unicode. I’m aiming for system 7 support too.
Will try to track down the Text Encoding Converter too and report anything I find here!
 
It shouldn't be too hard to port iconv.
Yeah that was my original thought too. I took a look at the source but didn’t try to compile - if I get past the prototype stage with my app I’ll look into posting, would anyone be interested in working on it with me?
 
Top