Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

CD 2.0.17 Internal Text Editor Bug?  Fun w/UTF-8

Version:

  CD 2.0.17 Home, build date 20030801A

Description:

  Internal text editor Replace All doesn't replace all.

To reproduce:

* Create empty external text file "junk.txt".
* Edit with NotePad.
* Type in text, no line delimiter (don't hit Enter, but I haven't tested this for significance)...
This|is|a|test|of|the|emergency|broadcasting|system.|This|is|only|a|test.
* Save and exit NotePad.
* Drag/drop junk.txt into CD.
* Double-click file inCD to edit.
* Menu: Edit|Replace...
* Find what: |
* Replace with: +++
* Click Replace All, click Cancel.
* Observe the result in the editor:
This+++is+++a+++test+++of+++the+++emergency+++broadcasting+++system.+++This|is|only|a|test.
* Note: It didn't replace all, it merely "replaced some."

I found this while having just a crap-tastic time struggling with UTF-8.  I now know more about UTF-8 than I care to <g>.

Tried to get CD to insert a Variable with the value of a one-char string of a 0xFF but no joy.  It arrived as the UTF-8 equivalent.  Problem is, lots of Java applets and ActiveX controls that'll pull a textdata file from the server do not speak UTF-8, the case at hand being IE's Tabular Data Control (TDC).

Read up on UTF-8 (zzz....) and realized that it only handles 0x00 - 0x7F as 8-bit chars (*smack* my forehead).  Ok, I'll use Ascii US (0x1F) and RS (0x1E) as Col and Row delims for the TDC.

Oops.  No soap!  The CD Variable entry form does not accept Alt-031 and Alt-030 entries (gak!).

Fire up NotePad again.  Type Alt-031, copy/paste into the CD Var form.  Back to NotePad, type Alt-030, copy/paste into the next Variable.  Write a page of documentation to myself to keep track of all this.


I was sort of chuckling about all the troubles 2.0 was giving others, feeling smugly immune.  I guess the pie is on the other face now, eh?


P.S. - This isn't a gripe, I *do* have a workaround right?  And CD is still the bee's knees and all that.

Bob Riemersma
Sunday, August 31, 2003

Oh MAN!!!

Ok, before text:

This|is|a|test|of|the|emergency|<fold>
broadcasting|system.|<fold>
This|is|only|a|test.

After text:

This+++is+++a+++test+++<fold>
of+++the+++emergency+++<fold>
broadcasting+++system.+++<fold>
This|is|only|a|test.

I hope this clarifies my example.

Bob Riemersma
Sunday, August 31, 2003

I think that the replace-all problem occurs if there is something selected when you start replacing, in which case it only replaces all in the selection.

It's not great and we're planning a bit of a refurbishment of search-and-replace UI.

Joel Spolsky
Tuesday, September 02, 2003

*  Recent Topics

*  Fog Creek Home