I have a program written a few years ago to run a "quiz show" under Perl using the Tk library for windowing. This year I hit the problem that one of my "contestants" has an Š in his name, which does not exist in ISO-8859-1.

If I convert the script to Unicode using iconv, I can add the character to the name, but Tk seems to see every thing as ISO-8859-1, so that the Unicode characters all become 2 character blocks. I like the angstrom symbol and all, but not when I'm trying to get an Š. Looking through the search on the site and in the Internet, it seems that this is an admitted problem with Perl-Tk, which the author is working on.

But this leaves me with a bit of a quandary, as I need the program this evening (I suppose I should have had more foresight...). Is there any "easy" solution to this? For instance, is there an alternative toolkit to which I can convert the program without spending hours learning a new system? Or a way to force Tk to play nice with the Unicode? Or... If all else fails, I'll strip the accent from the name, but that wouldn't be my preferred solution.

I am using perl 5.8.8-5 (FC5) with perl-Tk 804.027-9.


In reply to Using Unicode in Tk by mpolo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.