w10schools
Login Register
  • Home
  • Tutorials
    • HTML, CSS
      • HTML, HTML5
      • CSS, CSS3
    • XML
    • JavaScript, AJAX
    • PHP
    • Ruby on Rails
      • Ruby
      • Rails
    • ASP.NET
      • ASP
      • C# .NET
    • Java
      • JSP
    • Databases
      • MySQL
      • MSSQL Server
      • Oracle
    • Web Server
      • Windows
      • Linux
      • Apache
      • IIS
    • Design
      • Dreamweaver
      • Flash
      • Photoshop
      • Fireworks
      • CorelDRAW
      • Illustrator
  • References
    • HTML
      • Bootstrap
    • CSS
      • CSS Selectors
      • Sass
    • JavaScript
    • Mobile Apps
      • Cordova
    • Ruby on Rails
      • Ruby
      • Rails
    • PHP
      • Function
      • Language
      • CodeIgniter
      • Phalcon
      • PHPUnit
      • Symfony
      • Drupal
      • Yii
      • Laravel
    • Perl
      • Perl
    • Python
      • Python
      • Django
      • NumPy
      • Pandas
      • scikit-image
      • scikit-learn
      • Statsmodels
      • Matplotlib
    • Lua
      • Lua
    • C, C++
      • C
      • C++
    • Server
      • Docker
      • Apache HTTP Server
      • Nginx
    • Database
      • PostgreSQL
    • Big Data
      • TensorFlow
    • Game Development
      • Phaser
      • LÖVE
  • Articles
    • News
    • General
      • Website Promotion
      • Online Advertising
      • Make Money Online
    • Editorials
    • Interviews
    • Web Roundups
  • Resources
    • Design
      • Fonts
      • Graphics
      • Vectors
      • Templates
      • UI (User Interface)
      • Brushes
      • Patterns, Backgrounds
      • Textures
    • Web Development
      • HTML, CSS
      • XML
      • JavaScript, AJAX
      • Ruby on Rails
      • PHP
      • Java
      • .NET
      • Python
      • Perl
      • Flash
    • Mobile Application Development
      • Mobile Development Tools
      • Swift
    • Online Services
      • Online Storage
      • Web Hosting
  • Tools
    • Generators
Edit
In Place Editing Advanced Editing
  • References
  • Python
  • Django
  • API
  • Django Utils

utils.encoding.force_text()

force_text(s, encoding='utf-8', strings_only=False, errors='strict') [source]

Similar to smart_text, except that lazy instances are resolved to strings, rather than kept as lazy objects.

If strings_only is True, don’t convert (some) non-string-like objects.

Links:
  • https://docs.djangoproject.com/en/1.10/ref/utils/#django.utils.encoding.force_text
doc_Django
doc_Django
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.

Popular Articles
utils.encoding.force_str() force_str(s, encoding='utf-8', strings_only=False, errors='strict') Alias of force_bytes() on Python 2 and force_text() on Python 3. This function
utils.encoding.force_bytes() force_bytes(s, encoding='utf-8', strings_only=False, errors='strict') [source] Similar to smart_bytes, except that lazy instances are resolved to
utils.encoding.force_unicode() force_unicode(s, encoding='utf-8', strings_only=False, errors='strict') Historical name of force_text(). Only available under Python 2.
utils.encoding.smart_text() smart_text(s, encoding='utf-8', strings_only=False, errors='strict') [source] Returns a text object representing s – unicode on Python 2 and str o
email.utils.encode_rfc2231() email.utils.encode_rfc2231(s, charset=None, language=None) Encode the string s according to RFC 2231. Optional charset and language, if given is t


Return to View
  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share

Designed by : w10schools

service@w10schools.com

Our Partners: aeeble – Providing content publishing and search solutions