Internet Explorer wordwrap doesn't break at commas

I was modifying my web based thumbnail image viewer. Under each thumb I wanted the description of the photo. I wanted the photos to have captions below, and the unit to be rendered horizontally so they will fill the IE width. However, Internet Explorer will not break a line to wordwrap text after a comma if there is no space after it “like,this”. I didn’t want to modify the text in the database and insert spaces. One solution would be to find all occurrences of comma followed by a non-space and replace with comma space plus the non-space character. A simpler way: I just added a line to the HTML generator:

      notes= STRTRAN(STRTRAN(notes,",",", ")," "," ") && so IE wordwraps

First it replaces all commas with comma space, then it replaces all double spaces with a single space. This is extra work if the comma already had a space after it, but it was easy to do and the amount of extra work is peanuts compared to the disk I/O to get the thumbnail image.