GNOME Bugzilla – Bug 572439
Patch for CORBA_wstring_dup()
Last modified: 2009-10-28 09:41:58 UTC
The next entry will have a patch implementing CORBA_wstring_dup(). Please review.
Created attachment 129074 [details] [review] Implementation of wstring_dup() I'll like to get another set of eyes on this before I commit. Is it a good idea anyway? I can see that e.g. PortableServer_ObjectId_to_wstring() could use it.
looks fine to me; OTOH the concept of a separate 'wide-string' is so profoundly broken that the patch terrifies me ;-) Repeat after me: UTF-8, UTF-8, UTF-8 ;-) [ man utf-8 ] ... UTF-16, or worse some franken UCS-2 are just disaster areas in programmatic form [IMHO etc.]
I couldn't agree more. UTF-8 is really the only sensible thing to use at all. Everything else is foolish. The problem is that I had an itch to scratch. I had an area of code which could only use wide strings. The reason was that the remote server expected wide strings. Naturally I could transfer as UTF-8 and convert to UTF-16 in the other end, but just using UTF-16 from the start at the client end would be so very much cleaner. Seeing that ORBit2 already had its share of wide string code made the anguish, of introducing this little helper function, much easier to bear ;-) Well, it's only ~10 lines so it's easy to cut out and use directly instead of putting it into the API - no major pain. If someone else think this patch is a good idea I'll commit, otherwise I'll just forget it... Best, jules
heh ! of course you can commit it ! there's no issue there - but consider the evils of utf-16 first ;-)
Jules, did you want to commit this?
Patch is trivial & we should get it in & close this, if we can. Thanks.
Commited.