[Ironpython-users] [Newbee ironpython and WinForms] Problem of encodage with a ListBox (Winforms) - accented characters
bruno gallart
bruno.gallart at orange.fr
Sun Dec 23 19:04:19 CET 2012
I found the error (I think !). I should to unicode my choice. In the
listbox was "self._ltSuggestions.SelectedItem" but the encoding was
wrong. After research I put "unicode(self._ltSuggestions.SelectedItem)"
and it works well. I hope !
Good Christmas and good year for all the ironpython's users.
Best wishes,
Bruno
Le 21/12/2012 19:10, bruno gallart a écrit :
> Hi,
>
> I am doing a spellchecker with the Hunspell ' library for .Net -- >
> Nhunspell for a language of south of Europe (WinForms).
>
> My program runs well, it checks a Word's document, gives all the wrong
> words etc... With a button I pass all the wrong words and for every
> word, it gives me, in a ListBox, all the suggestions for this word.
>
> My problem:
> If the suggestion is a word without accented character I can choose it
> and put it in the Word's document, it is fine ! But if this word has
> accented character when I choose it in the listbox (it is seen well
> with the accented character) I have an error message (in french) but
> it is a problem of encoding (my translation not very good "impossible
> to give an encoding from the unicode page") in french ("Impossible de
> traduire les octets [E8] à l'index 0 à partir de la page de codes
> spécifiée en Unicode"). It is for exemple, for the words " òme " ,
> "òbra" etc...
>
> I am a newbee in .NET and Winforms, I am quite lost
> My questions :
> My program is encoding in UTF-8,
> What encoding gives the string coming from " listBox.SelectedItem " I
> think Unicode ?
> The NHunspell's files for check ( xx.aff and ww.dic ) are with "
> alphabet occidental" ("iso-8859-15")
>
> What can I do ? I transform the encoding of the ListBox's string ...
> but how ? I don't know the command . Or there is an another thing to do ?
>
> Thanks for your patience
>
> Bruno
> _______________________________________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> http://mail.python.org/mailman/listinfo/ironpython-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20121223/19e88c2b/attachment.html>
More information about the Ironpython-users
mailing list