March 26th, 2002

  • fuchs

(no subject)

Hey all,

since this morning (CET) I face a strange problem when loading my friends page.
It says:

Fatal error: Can't call method "quote" on an undefined value at /home/lj/cgi-bin/ line 3025.

Right now, I do not have the time to look deeper into it, but I wanted to inform you about it.
  • Current Mood

problem with icky HTML in logprops (specifically music)

(I previously entered this in /support/, but no response.)

As discussed in this lj_dev post, the music field can get terminated. This leads to situations like this talkread page where the music field actually has a link in it (which might not be a good idea to allow anyway) but it gets snipped in the middle of the href URL, leading to gross ugliness. Something in the code (htmlclean?) goes crazy and starts URL-escaping a massive amount of text. Unfortunately, I'm not quite sure how to fix it right now. This isn't just a problem for talkread; it can mess up lastn and friends pages too.

Note that merely fixing the truncation thing won't fix this; if you manually type in a music field that ends in the middle of a quoted thing in a tag attribute, the same bug will happen.

Perhaps logprop fields need to be somehow cleaned before being inserted into text?
amused, happy
  • mart

URLEncoding with UTF-8

This is actually a client question, but since it's to do with stuff which is happening on the server, and the people who know the answers read this community a whole lot more than the clients community, I've asked here. Shoot me.

I was playing around with writing a Microsoft.NET library for LiveJournal clients. Now, I know about three other people at least are also doing this, but it was mostly just something productive to do while I was learning how it all fits together and learning the C# language, so I'm not trying to tread on anyone's toes.

One thing I'm trying to be aware of is that LiveJournal's going to be expecting UTF-8 soon. My first question is whether UTF-8 should be sent when $LJ::UNICODE is off on the server. Will the server be able to intelligently convert to some other encoding, or does that logic have to be client-side? (...and, in the latter case, will the server provide this information at login?)

My second question regards how to encode UTF-8 when doing URLencoding for the flat interface. My current logic gets a byte array using the UTF-8 encoder (part of the standard .NET class library) and then changes each individual byte into its hexidecimal encoding notation. The multi-byte characters get converted into two consecutive URL-encoded values, then. Is this correct operating procedure, or should I be doing something different?