Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7404659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:17:11+00:00 2026-05-29T05:17:11+00:00

I show a unicode string from an xml file in a QLabel. I need

  • 0

I show a unicode string from an xml file in a QLabel. I need to show H2O in a QLabel but with the digit ‘2’ as subscript (Unicode character U+2082). QLabel can take an html string but I can’t put this html into the xml.

It shows correctly in Linux, but in Windows it shows some garbage instead of subscript 2. I tried many different methods (incl. changing font family), but none of them works in Windows. Why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:17:12+00:00Added an answer on May 29, 2026 at 5:17 am

    This is probably a font issue, rather than Python. Not all fonts in Windows have U+2082. You need to pick a proper font that contains this character.

    For example “Arial Unicode MS” has this. Consider the example below:

    import sys
    from PyQt4 import QtGui
    
    app = QtGui.QApplication(sys.argv)
    widget = QtGui.QWidget()
    
    unicode_font = QtGui.QLabel(u"Unicode Font: H\u2082O")
    unicode_font.setStyleSheet("font-family: 'Arial Unicode MS', Arial, sans-serif; font-size: 15px;") 
    
    normal_font = QtGui.QLabel(u"Normal Font: H\u2082O")
    normal_font.setStyleSheet("font-family: Arial, sans-serif; font-size: 15px;")
    
    
    layout = QtGui.QVBoxLayout()
    layout.addWidget(unicode_font)
    layout.addWidget(normal_font)
    widget.setLayout(layout)
    widget.show()
    sys.exit(app.exec_())
    

    On Win 7 32-Bit it gives:

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to see some string with Unicode characters in the Xcode console when
How can I show an nvarchar column that stores unicode data (Entered with the
I know loading unicode is a somewhat laboured point, but I can't see how
There is a special character which can be seen here http://www.fileformat.info/info/unicode/char/1f4a9/index.htm I have the
I'm writing an applet that's supposed to show both English and Japanese (unicode) characters
This .show and .hide works great in Firefox 3 but not in IE 7.
Using this function in my C# exe, I try to pass a Unicode string
I am trying to show नेपाल at my page, but is shows नेपाल. What
Is there a way to globally suppress the unicode string indicator in python? I'm
I have some Python code that's receiving a string with bad unicode in it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.