#61 Cannot use "accents" in docstrings

defect
closed-fixed
parser (18)
5
2003-01-18
2002-08-12
Anonymous
No

When using "accents" (is that the correct word ?) in
docstrings (lof of them in French as in "marié", or "ŕ
la place"), the italic and bold StructuredText tags are
ignored (*marié* or **marié**)

As soon as I remove those accents, the tags work.

May be same issue as 504810 ?

The StructText *Procedure ŕ suivre* is converted as :

<em>Procedure a &lt suivre</em>

StructuredText is about having a good looking output
while not needing html and making unreadable inline
comments. That kind of problem makes it difficult as I
need to tell people not to use those "accents".

Discussion

  • Anonymous - 2002-08-21

    Logged In: YES
    user_id=83322

    Problem is located (at least) in ClassidDocumentClass.py
    (part of ST code). Every doc_whatever (doc_underline,
    doc_strong ...) function uses a regexp that matches
    <marker>string<marker>.

    However, the "string" is matched using the "letters"
    variable from STletters.

    This one is itself the string.letters. But it doesn't take
    into account the letters with accents.

    Workaround is to modify in STletters.py the "letters" init.
    with those accents :

    letters = string.letters + ""

    Now **mari** is correctly output as <strong>mari</strong>.
    Great !

     
  • Doug Hellmann

    Doug Hellmann - 2002-08-25

    Logged In: YES
    user_id=34486

    It looks like there is an even better solution. If
    setlocale() is called, the string module is properly
    initialized and all of the accented characters make it into
    the set of letters. I am regression testing the change right
    now, but if you want to quickly patch your copy you can
    modify the happydoc script and add these lines:

    import locale
    locale.setlocale(locale.LC_ALL, '')

    before any other imports.

    Doug

     
  • Doug Hellmann

    Doug Hellmann - 2002-08-25
    • summary: Cannot use "accents" in docstrings --> Cannot use "accents" in docstrings
     
  • Doug Hellmann

    Doug Hellmann - 2003-01-18
    • status: open --> closed
     
  • Doug Hellmann

    Doug Hellmann - 2003-01-18
    • summary: Cannot use "accents" in docstrings --> Cannot use "accents" in docstrings
    • status: closed --> closed-fixed
     
  • Doug Hellmann

    Doug Hellmann - 2003-01-18

    Logged In: YES
    user_id=34486

    This should be resolved by the proper use of locales in 2.x.

     

Log in to post a comment.