[Opensim-dev] Partial libSL.Packet fix submitted

Stefan Andersson stefan at tribalmedia.se
Thu Dec 20 14:42:44 UTC 2007


... once upon a time... somebody in this project (no, not me, honestly!) didn't really know how the xmlWriter works, so somebodys generated xml came out with the header claiming the document to be utf-16 when clearly, it was not, and the LL client crashed because of that.
 
The solution? Looking up how you make sure the xmlWriter output the correct charset and header? Use the underlying stream as base for the xmlWriter? No... the solution was... write it all to a string, then do xmlStr.Replace ("utf-16", "utf-8") in all places where this error occured.
 
I'm still considering that one for the daily Worse Than Failure.
http://thedailywtf.com/
/Stefan


Date: Thu, 20 Dec 2007 08:28:25 -0500From: teravus at gmail.comTo: opensim-dev at lists.berlios.deSubject: Re: [Opensim-dev] Partial libSL.Packet fix submitted
Well, alternatively, you could strip out the hyphens where needed.
 
ToString.Replace FTW!!!111!!1!1!!11!1!!One 
On 12/20/07, Justin Clark-Casey <jjustincc at googlemail.com> wrote: 
Johan Berntsson wrote:> This problem is not caused by my work, but of changes in later versions> of LibSL. It has changed from using ToString (unhyphenated) and> ToStringHyphenated(), to only using ToString() (hyphenated). This means> that there is no way of getting an unhyphenated string from libSL > anymore. I changed all instances of  ToStringHyphenated() in OpenSim to> ToString(), but I didn't realize that there would be a problem with> plain ToString() calls.>> The basic problem is that we are relying on a libSL behaviour that is > outside our control, and has changed. If we want to keep up to date with> libSL I suggest that the problem is solved.>> Possible solutions:> 1. Identify the problematic ToString() calls and use a utility function > (Util.ConvertToUnhyphentated) to fix them like before.> 2. Write scripts to update the current databases to use hyphenated> GUID:s> 3. Change the code not to use ToString at all.>> I prefer option 3, and to be compatible it could output unhyphenated > GUIDs. At least this means that we won't have problems every time libSL> is refactored (and ToString is meant as a debug tool, not as a provider> of keys to a database)>Is there any chance that, if asked, the LibSL folks would add extra methods such asToGuidString()ToGuidHyphenatedString()?  We would still be relying on LibSL but with explicitly named andpurposed methods such as these rather than ToString(), I would hopeno-notice refactoring would be much less likely. If necessary, we could then migrate to our own methods at our leisure(after patching all the string calls to use these two methods).Even if they won't do this, we could patch their code in the meantime for these methods (I doubt that would be very complicated) if migratingnow would be considerable and destablizing work (in light of 0.5).Regards,--justincc_______________________________________________ Opensim-dev mailing listOpensim-dev at lists.berlios.dehttps://lists.berlios.de/mailman/listinfo/opensim-dev 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20071220/b1dc91e7/attachment-0001.html>


More information about the Opensim-dev mailing list