Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Failure to detect strings that look completely identical


From   Ronan Conroy <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Failure to detect strings that look completely identical
Date   Wed, 23 Nov 2011 14:01:26 +0000

On 2011 Samh 22, at 19:50, Nick Cox wrote:

> The help for -charlist- (SSC) documents that char(32) and char(160)
> are hard to tell apart:
> 
> . di "|`=char(32)'|"
> | |
> 
> . di "|`=char(160)'|"
> | |
> 
> So, watch out for char(160).

Your mileage may vary

Mac OS X

. di "|`=char(160)'|"
|†|

. di "|`=char(32)'|"
| |

I got caught out, years ago, by data contaminated by ASCII 30 - the infamous null character. It was used by MS Word to indicate end of file, and could sneak into data. 

. di "|`=char(30)'|"
||

However, if I paste this output into BBEdit and view invisibles, I can see the little horror, which BBEdit displays as a red ¿. (If your mailer hasn't shown you a Spanish inverted question mark, well, that's mailers for you.)

. di "|`=char(30)'|"
|¿|

Null is particularly nasty because it has no width, so it's very hard to spot.



Ronán Conroy
[email protected]
Associate Professor
Division of Population Health Sciences
Royal College of Surgeons in Ireland
Beaux Lane House
Dublin 2


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index