Thread: MacRoman character set

MacRoman character set

From
eric soroos
Date:
Hi,

I've got an app using the libpq interface that uses the mac roman character set (natively, and I don't think I can
changeit). I'm using the 7.2.x releases of pg right now. The clients are all running OSX, some of the servers are on
OSX,some on debian linux. (for the hackers, a MacRoman - unicode conversion table is here:
http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT)  

I would like to transparently encode/decode to SQL_ASCII all connections from this client app.  I don't necessarily
wantto encode/decode all connections from this ip address, as backup and psql are both run on the machine as well.
Thereare four possible locations that I can think of to insert the conversion: 

1) do it in my app. - violates the transparency desire
2) do it in the glue between my ap and libpq - being investigated
3) create a new character set in the backend and set the client encoding.
4) use the --enable-recode option to make the change on an ip by ip basis - this complicates backups.

Of these, I think #3 is the cleanest, but it's also the one that I have no idea as to the scope. How hard is it to add
anothercharacter set as a conversion target, but not one allowed as a backend storage format (sort of like the windows
characterset that doesn't have a unix code page?)  If it's not that hard, is this something that could be applied to
the7.2 series or would I have to upgrade to current?  

eric