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

What's with the accent marks and sterling pounds? I read that as a variable name, but why use two chars for an arbitrary name? Must be something special, or something else that got displayed wrong.

Replies are listed 'Best First'.
Re: Re: Re: English Date-Suffixes
by BrowserUk (Patriarch) on Nov 04, 2002 at 21:45 UTC

    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
      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