Project

General

Profile

Feature #814

mimetype.charset?

Added by Anonymous almost 14 years ago. Updated almost 12 years ago.

Status:
Wontfix
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

Description

Something like apache's AddDefaultCharset, setting default charsets for all mimetypes. I wish to set mimetype.charset = "utf-8" and all mimetypes should have "; charset=utf-8". For now i have to add charset to every mimetype in mimetype.assign.

#1

Updated by jan almost 14 years ago

  • Status changed from New to Fixed
  • Resolution set to wontfix

There is no way to tell which Content-Type should have a charset and which shouldn't.

Content-Type: image/png; charset=utf-8

doesn't make sense and could cause trouble.

application/* is partly charset based and partly not:

- application/octet-stream
- application/xml+xhtml

#2

Updated by Anonymous over 13 years ago

  • Status changed from Fixed to Need Feedback
  • Resolution deleted (wontfix)

I think that as said the anterior 'anonymous' should to be a variable as '_'mimetype.charset = "utf-8"'_' to indicate the character set by default.

So instead of have to writing the same for each type where is needed ('_'; charset=utf-8'_') as in this example that I'm using:


## mimetype mapping
mimetype.assign            = (
".css"          =>      "text/css; charset=utf-8",
".htm"          =>      "text/html; charset=utf-8",
".html"         =>      "text/html; charset=utf-8",
".txt"          =>      "text/plain; charset=utf-8",
".gif"          =>      "image/gif",
".jpg"          =>      "image/jpeg",
".jpeg"         =>      "image/jpeg",
".png"          =>      "image/png",
".svg"          =>      "image/svg+xml; charset=utf-8",
".svgz"         =>      "image/svg+xml; charset=utf-8",
".js"           =>      "application/x-javascript; charset=utf-8",
".xml"          =>      "application/xml; charset=utf-8",
".xsl"          =>      "application/xml; charset=utf-8",
".atom"         =>      "application/atom; charset=utf-8",
".rss"          =>      "application/rss+xml; charset=utf-8",
".pdf"          =>      "application/pdf",
".swf"          =>      "application/x-shockwave-flash",
# the default mime type.
#""              =>      "text/plain; charset=utf-8" 
)

there would be anything as:


".css"          =>      "text/css; char",
...

Then '_*char*_ would be changed by the value of '_*mimetype.charset*_.

The idea is set a variable with a value by default and then use it only where is necessary.

#3

Updated by stbuehler about 12 years ago

  • Status changed from Need Feedback to Fixed
  • Resolution set to wontfix

Use include_shell if you need such custom behaviour.

#4

Updated by stbuehler almost 12 years ago

  • Status changed from Fixed to Wontfix

Also available in: Atom