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

  • SEARCH
  • Home
  • 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 6875919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:24:49+00:00 2026-05-27T04:24:49+00:00

I tried to serve an html page that includes unicode text using django and

  • 0

I tried to serve an html page that includes unicode text using django and received the following:

UnicodeDecodeError at /my_page.html
'utf8' codec can't decode bytes in position 28283-28287: unsupported Unicode code range
Request Method: GET
Request URL:    http://mysite.com/my_page.html
Django Version: 1.2.4
Exception Type: UnicodeDecodeError
Exception Value:    
'utf8' codec can't decode bytes in position 28283-28287: unsupported Unicode code range
Exception Location: /usr/local/lib/python2.6/encodings/utf_8.py in decode, line 16
Python Executable:  /usr/local/bin/python
Python Version: 2.6.5

The page was generated by (please don’t kill me) MS Word, but when I saved it I made sure it was set to utf8. Also the file has the following tag in its heading:

<meta http-equiv=Content-Type content="text/html; charset=utf-8">

I do need to keep the unicode as the page is not in English. What can I do so that django will present the page?
Why does django care and not simply give the browser to handle it?(locally the page is ok of course)

Could it be that it’s because django is trying to process this page as a template? I used the following in urls.py in order to redirect to the file itself:

(r'(.+).html$', 'django.views.generic.simple.direct_to_template'),
  • 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-27T04:24:49+00:00Added an answer on May 27, 2026 at 4:24 am

    Are you sure the file is valid? It wouldn’t be the first time that MS Word produce invalid data. And if there are characters that aren’t valid Unicode, that would well explain this error. Have a look at the given bytes, if they are sensible.

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

Sidebar

Related Questions

I have a html page that calls a php object to get some data
i had an html page that run some jQuery scripts and that works ok.
Hi. I've been trying to create a PHP page using Savant Templating Engine that
Has anyone tried installing SQL Server 2008 Developer on a machine that already has
I tried to turn on the Activity Monitor using SQL Server 2008 Management Studio
Cdonts is not working in server 2008 (im using 32bit) i tried copying cdonts.dll
I've honestly tried this left and right and still find that my mirror server,
We are working on using a 3rd party's ActiveX control within a web page.
I am using ASP.NET MVC 2 & C#. I want to include/embed an html
I am writing a some code that to dynamically include an HTML snippet in

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.