in reply to Re: Re: English Date-Suffixes
in thread English Date-Suffixes

In essence, any single char scalar name would do.

I started using $£ as a variable name in golf-type solutions as its the only punctuation global that isn't used for something somewhere by Perl itself, therefore it doesn't cause warnings with strict, and I don't have to localise it.

Quite why one instance of the £ character got converted during the process of posting the code, and none of the others did I am not quite sure. I even tried to correct it by cut&pasting one of the others that shows correctly (in my browser at least) over the top of the one that comes out wrong, but the results where always the same. I have no idea how to correct it.


Nah! Your thinking of Simon Templar, originally played by Roger Moore and later by Ian Ogilvy

Replies are listed 'Best First'.
Re: Re: Re: Re: English Date-Suffixes
by John M. Dlugosz (Monsignor) on Nov 04, 2002 at 21:56 UTC
    I'm seeing "the £ character" as two glyphs everywhere in your post: Capital letter A with Circumflex, and Pound Sign.

    0xC3 0xa3 looks like valid UTF-8, in that the first begins with 110... and the second is 10... bits. So Unicode E3 is what you typed? that's Small letter a with Tilde, which isn't a particularly unique character so I don't think that's what you were referring to.

    So what character is supposed to be there?

    How to correct: use the HTML Entity name. Then it's either correct or "escaped out but obvious what was meant" no matter what code page the browser is using. It also might make sence for the PM pages to bear a charset indicator so that browser doesn't have to guess.

    —John

      I'm seeing "the £ character" as two glyphs everywhere in your post

      Hmmm. Strange. I see one instance of where the pond sign shows up incorrectly in my original post.Its the first one in the second code block ($£=pop) which shows up as a broken utf char in my browser (ie ($��=pop)). Looking at the source, this is because of a bug in the autowrap code that is used to break long lines which is inserting

      <font color="red"><b><u>&#173;</u></b></font>

      in between two bytes of a valid 2-byte utf-16 character therebye causing it to be invalid. There is nothing I can do to prevent the autwrap code form doing this.

      use the HTML Entity name

      The problem with that is that in every case where I have used the £ character (except that one) in this thread, it has been embedded within <code>...</code> brackets, and (as far as I know), stuff inside code brackets shouldn't be modified before display, so embedding an HTML entity would produce equally confusing results. It would also be a pain to have to edit the code that looks fine in my editor and browser and works fine with perl itself, each time I paste it.

      The code I am pasting into the edit field is valid utf-16 and (when the autowrap feature doesn't interfere), it should show up correctly as a £ sign in your browser if you have a utf-16 enabled font configured. It does so for me in Opera 6.1. (I just typed that last £ on my keyboard with no escaping of any kind).


      Nah! Your thinking of Simon Templar, originally played by Roger Moore and later by Ian Ogilvy
        Hmm, the bytes I'm seeing are not UTF-8 for the pound sign. If I change IE5's setting to use UTF-8 encoding rather than "automatic", then I see the pound sign in the browser, but View Source still shows what I think must be C3 A3. Ahh (double checking), A-with-curcumflex is C2, not C3. Now it checks: I'm seeing the bytes interpreted in the Latin 1 character set.

        I suppose that in absence of any charset attribute or indicator, Windows uses its current 8-bit character set.

        I wonder why PerlMonks doesn't use a charset meta tag?

        —John