> > I think this is because Firefox is sending 2 bytes per character > (wide chars). I dumped the first 10 bytes of 'urls' to > stdout and > piped it through 'od -x', and found it was getting the > hex sequence: > 68 00 74 00 74 00 70 00 3a 00 > ..which is the first part of "http:" with a null after > every character. > > So to support Firefox, possibly just checking to see if > a) the string > length is greater than 2, and urls[1] == 0, and if so, > assume wide chars, > and just skip every other byte to accumulate the string.
Hmmm, I think I'd caution against that approach - that'll only work if (a) the characters in your string are from the "ASCII" range and (b) the wide chars you get are actually 16-bit. If any of your characters actually require a value outside the ASCII range the MS-byte won't be "null" in that case and odd things will happen... You really need to check if the "upper" byte is non-zero and process it "properly" if it is (although discarding it, if it is zero, is a "valid" hack in many cases.) I'm surprised they were 16-bit actually, I've never checked specifically, but I thought firefox was using either UTF-8 (which *would* look like straight ASCII in this case) or UCS-4 (which would look like 32-bits) on my machines. Greg, do you have your locale set fot utf-8 or...? SELEX Sensors and Airborne Systems Limited Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL A company registered in England & Wales. Company no. 02426132 ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

