<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>... 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.<BR>
<BR>
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.<BR>
<BR>
I'm still considering that one for the daily Worse Than Failure.<BR>
<A href="http://thedailywtf.com/">http://thedailywtf.com/</A><BR>
<BR>/Stefan<BR><BR><BR>
<BLOCKQUOTE>
<HR id=EC_stopSpelling>
Date: Thu, 20 Dec 2007 08:28:25 -0500<BR>From: teravus@gmail.com<BR>To: opensim-dev@lists.berlios.de<BR>Subject: Re: [Opensim-dev] Partial libSL.Packet fix submitted<BR><BR>
<DIV>Well, alternatively, you could strip out the hyphens where needed.</DIV>
<DIV> </DIV>
<DIV>ToString.Replace FTW!!!111!!1!1!!11!1!!One<BR><BR> </DIV>
<DIV><SPAN class=EC_gmail_quote>On 12/20/07, <B class=EC_gmail_sendername>Justin Clark-Casey</B> <<A href="mailto:jjustincc@googlemail.com">jjustincc@googlemail.com</A>> wrote:</SPAN>
<BLOCKQUOTE class=EC_gmail_quote style="PADDING-LEFT: 1ex; BORDER-LEFT: #ccc 1px solid">Johan Berntsson wrote:<BR>> This problem is not caused by my work, but of changes in later versions<BR>> of LibSL. It has changed from using ToString (unhyphenated) and<BR>> ToStringHyphenated(), to only using ToString() (hyphenated). This means<BR>> that there is no way of getting an unhyphenated string from libSL <BR>> anymore. I changed all instances of ToStringHyphenated() in OpenSim to<BR>> ToString(), but I didn't realize that there would be a problem with<BR>> plain ToString() calls.<BR>><BR>> The basic problem is that we are relying on a libSL behaviour that is <BR>> outside our control, and has changed. If we want to keep up to date with<BR>> libSL I suggest that the problem is solved.<BR>><BR>> Possible solutions:<BR>> 1. Identify the problematic ToString() calls and use a utility function <BR>> (Util.ConvertToUnhyphentated) to fix them like before.<BR>> 2. Write scripts to update the current databases to use hyphenated<BR>> GUID:s<BR>> 3. Change the code not to use ToString at all.<BR>><BR>> I prefer option 3, and to be compatible it could output unhyphenated <BR>> GUIDs. At least this means that we won't have problems every time libSL<BR>> is refactored (and ToString is meant as a debug tool, not as a provider<BR>> of keys to a database)<BR>><BR>Is there any chance that, if asked, the LibSL folks would add extra <BR>methods such as<BR><BR>ToGuidString()<BR>ToGuidHyphenatedString()<BR><BR>? We would still be relying on LibSL but with explicitly named and<BR>purposed methods such as these rather than ToString(), I would hope<BR>no-notice refactoring would be much less likely. <BR><BR>If necessary, we could then migrate to our own methods at our leisure<BR>(after patching all the string calls to use these two methods).<BR><BR>Even if they won't do this, we could patch their code in the meantime <BR>for these methods (I doubt that would be very complicated) if migrating<BR>now would be considerable and destablizing work (in light of 0.5).<BR><BR>Regards,<BR><BR>--<BR>justincc<BR>_______________________________________________ <BR>Opensim-dev mailing list<BR><A href="mailto:Opensim-dev@lists.berlios.de">Opensim-dev@lists.berlios.de</A><BR><A href="https://lists.berlios.de/mailman/listinfo/opensim-dev" target=_blank>https://lists.berlios.de/mailman/listinfo/opensim-dev </A><BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></body>
</html>