illegal character

Discussion in 'C Programming' started by sergej.vasiljev@gmail.com, Jun 14, 2005.

  1. Guest

    Hello,

    while doing strings pattern matching we use '/377' character.
    But this char is illegal for some Asian locales on Solaris.
    For example, strcoll returns error because this character is outside
    the domain of the collating sequence.

    Which other character can be used instead?

    Thanks.
    , Jun 14, 2005
    #1
    1. Advertising

  2. wrote:
    > Hello,
    >
    > while doing strings pattern matching we use '/377' character.
    > But this char is illegal for some Asian locales on Solaris.
    > For example, strcoll returns error because this character is outside
    > the domain of the collating sequence.
    >
    > Which other character can be used instead?
    >
    > Thanks.
    >


    strcmp() is locale-independent.

    man regexp

    shows you another powerful alternative.


    --
    Michael Tosch @ hp : com
    Michael Tosch, Jun 14, 2005
    #2
    1. Advertising

  3. Guest

    our application work in different locales and what is why strcmp is not
    acceptable for us.
    , Jun 14, 2005
    #3
  4. Guest

    our application works in different locales and what is why strcmp is
    not acceptable for us.
    , Jun 14, 2005
    #4
  5. On Tue, 14 Jun 2005 00:35:50 -0700, sergej.vasiljev wrote:

    > Hello,
    >
    > while doing strings pattern matching we use '/377' character.
    > But this char is illegal for some Asian locales on Solaris.
    > For example, strcoll returns error because this character is outside
    > the domain of the collating sequence.
    >
    > Which other character can be used instead?


    The C language itself doesn't define specific character sets. If \377 is
    not a valid character in a particular locale the question arises as to why
    it is appearing in data for that locale. You'll need to decide how you
    want to interpret such values.

    It may be that \377 is being used as an escape character for multibyte
    character encoding and as such it would not by itself be considered a
    valid character.

    Ultimately these issues are platform-specific so to resolve this for
    Solaris or at least get a Solaris-aware solution you might try asking in
    comp.unix.solaris.

    Lawrence
    Lawrence Kirby, Jun 14, 2005
    #5
  6. pete Guest

    Michael Tosch wrote:

    > strcmp() is locale-independent.


    Though whether strcmp("A","B") is positive or negative
    is implementation defined.

    --
    pete
    pete, Jun 14, 2005
    #6
    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. William Brogden
    Replies:
    1
    Views:
    8,339
    Manoj S. P.
    Jun 30, 2003
  2. Michael Lee
    Replies:
    0
    Views:
    1,536
    Michael Lee
    Jun 27, 2003
  3. Timo Nentwig
    Replies:
    1
    Views:
    3,540
    Igor N. Kolomiyets
    Feb 6, 2004
  4. Steve Rainbird

    illegal escape character

    Steve Rainbird, Jun 7, 2006, in forum: Java
    Replies:
    7
    Views:
    18,261
    Mark Space
    Jun 8, 2006
  5. Andy Fish

    illegal character in xml file

    Andy Fish, Feb 6, 2007, in forum: XML
    Replies:
    1
    Views:
    530
    Joseph Kesselman
    Feb 6, 2007
Loading...

Share This Page