Problem defining an entity (ÿ)

Discussion in 'XML' started by Luke Guest, Nov 19, 2003.

  1. Luke Guest

    Luke Guest Guest

    Hi,

    I'm trying to implement a parser using the XercesC parser under Windaz. I
    have a simple structure which is defined using my dtd file. I also require
    the use of special sequences of characters so I have tried to define an
    entity:

    <!ENTITY CONTROL_CODE_CHAR "ÿ"> <!-- 255 -->

    This doesn't work, so I have tried this:

    <!ENTITY CONTROL_CODE_CHAR "ÿ"> <!-- 255 -->

    Which doesn't hang the parser, but does *not* give me the yalet character.

    I have a line in my xml file:

    ....
    <ITEM>&CONTROL_CODE_CHAR; ERROR!</ITEM>
    ....

    This gives me the text " ERROR!" which is wrong, how do I get this character
    to be processed properly?

    I'm using this line inside my xml file:

    <?xml version="1.0" encoding="windows-1252"?>

    FYI, I will also need to build up more control codes using this as a base.

    Thanks,
    Luke.
    Luke Guest, Nov 19, 2003
    #1
    1. Advertising

  2. In article <3fbbaaf7.0@entanet>, Luke Guest <> wrote:

    ><!ENTITY CONTROL_CODE_CHAR "ÿ"> <!-- 255 -->


    That should work, assuming you're typing it in the encoding you specify.

    ><!ENTITY CONTROL_CODE_CHAR "ÿ"> <!-- 255 -->


    And so should this, regardless of the encoding.

    >...
    > <ITEM>&CONTROL_CODE_CHAR; ERROR!</ITEM>
    >...
    >
    >This gives me the text " ERROR!" which is wrong, how do I get this character
    >to be processed properly?


    Are you sure that the *output* is in the encoding you expect? If you
    are outputting in, say, UTF-8 you will get different bytes from the
    ones you expect.

    -- Richard
    --
    Spam filter: to mail me from a .com/.net site, put my surname in the headers.

    FreeBSD rules!
    Richard Tobin, Nov 19, 2003
    #2
    1. Advertising

  3. Re: Problem defining an entity (?)

    "Luke Guest" <> wrote:

    > X-Newsreader: Microsoft Outlook Express 6.00.2800.1106


    If you want to transmit special, non-ASCII characters, you need to
    choose

    Tools > Options > Send
    Mail Sending Format > Plain Text Settings > Message format MIME
    News Sending Format > Plain Text Settings > Message format MIME
    Encode text using: None

    in this simulation of a newsreader.

    > <!ENTITY CONTROL_CODE_CHAR "?"> <!-- 255 -->
    > <!ENTITY CONTROL_CODE_CHAR "ÿ"> <!-- 255 -->


    What makes you think that char xFF = 255 is a control character?

    > the yalet character.


    I beg your pardon?

    > I'm using this line inside my xml file:
    > <?xml version="1.0" encoding="windows-1252"?>


    There is no need to use a Microsoft-proprietary, Windows-specific
    encoding here. Use ISO-8859-1 instead. Actually, both agree on
    char xFF = 255 being a "y with diaeresis" (ÿ) but not a control
    character.

    --
    Top posting.
    What's the most irritating thing on Usenet?
    Andreas Prilop, Nov 19, 2003
    #3
  4. Re: Problem defining an entity (?)

    On Wed, 19 Nov 2003 20:01:29 +0100, Andreas Prilop wrote:

    > in this simulation of a newsreader.
    >
    >> <!ENTITY CONTROL_CODE_CHAR "?"> <!-- 255 -->
    >> <!ENTITY CONTROL_CODE_CHAR "ÿ"> <!-- 255 -->

    >
    > What makes you think that char xFF = 255 is a control character?


    It's a control character in my application.

    >> the yalet character.

    >
    > I beg your pardon?


    If you search for that character, the name seems to be "yalet."

    >> I'm using this line inside my xml file:
    >> <?xml version="1.0" encoding="windows-1252"?>

    >
    > There is no need to use a Microsoft-proprietary, Windows-specific
    > encoding here. Use ISO-8859-1 instead. Actually, both agree on
    > char xFF = 255 being a "y with diaeresis" (ÿ) but not a control
    > character.


    Hmmm.
    Luke A. Guest, Nov 19, 2003
    #4
  5. Re: Problem defining an entity =?iso-8859-1?b?KP8p?=

    On Wed, 19 Nov 2003 18:07:12 +0000, Richard Tobin wrote:

    > In article <3fbbaaf7.0@entanet>, Luke Guest <> wrote:
    >
    >><!ENTITY CONTROL_CODE_CHAR "ÿ"> <!-- 255 -->

    >
    > That should work, assuming you're typing it in the encoding you specify.
    >
    >><!ENTITY CONTROL_CODE_CHAR "ÿ"> <!-- 255 -->

    >
    > And so should this, regardless of the encoding.
    >
    >>...
    >> <ITEM>&CONTROL_CODE_CHAR; ERROR!</ITEM>
    >>...
    >>
    >>This gives me the text " ERROR!" which is wrong, how do I get this character
    >>to be processed properly?

    >
    > Are you sure that the *output* is in the encoding you expect? If you
    > are outputting in, say, UTF-8 you will get different bytes from the
    > ones you expect.


    Ah, any pointers on how to specify that I want ISO-8859-1?

    Thanks,
    Luke.
    Luke A. Guest, Nov 19, 2003
    #5
  6. Re: Problem defining an entity (?)

    "Luke A. Guest" <> wrote:

    >> What makes you think that char xFF = 255 is a control character?

    >
    > It's a control character in my application.


    Then the encoding cannot be either ISO-8859-1 or Windows-1252.
    It could be x-user-defined or something like that. But what is the
    definition and function of your control character?

    > If you search for that character, the name seems to be "yalet."


    No. <http://www.google.com/search?q=yalet+character>
    Andreas Prilop, Nov 19, 2003
    #6
  7. Re: Problem defining an entity (?)

    On Wed, 19 Nov 2003 23:27:57 +0100, Andreas Prilop wrote:

    > "Luke A. Guest" <> wrote:
    >
    >>> What makes you think that char xFF = 255 is a control character?

    >>
    >> It's a control character in my application.

    >
    > Then the encoding cannot be either ISO-8859-1 or Windows-1252.
    > It could be x-user-defined or something like that. But what is the
    > definition and function of your control character?


    The XML file format I have defined is for defining text (in games), it'll
    be read in and then dumped out as a big block of binary. The control
    characters are used to control things like colour. I don't know why
    ISO-8859-1 or windows-1252 cannot be used. All I need is a way to get that
    character to be created in my output text after it has been parsed.

    >> If you search for that character, the name seems to be "yalet."

    >
    > No. <http://www.google.com/search?q=yalet+character>


    Yeah, ok...

    Luke.
    Luke A. Guest, Nov 19, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    650
    Sajan
    Feb 4, 2004
  2. Samuel van Laere

    Entity Name or Entity Number?

    Samuel van Laere, Feb 24, 2007, in forum: HTML
    Replies:
    4
    Views:
    1,596
    Jukka K. Korpela
    Feb 24, 2007
  3. markla
    Replies:
    1
    Views:
    531
    Steven Cheng
    Oct 6, 2008
  4. Norm
    Replies:
    3
    Views:
    2,678
  5. ThatsIT.net.au

    Entity, problem with entity key

    ThatsIT.net.au, Sep 6, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    1,179
    ThatsIT.net.au
    Sep 7, 2009
Loading...

Share This Page