What is MIME type "text/x-component-pascal"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

MIME type: text/x-component-pascal
This type designates plain text files that hold Component Pascal source code.
Files with this MIME type use the file extension CP.

The MIME type helps software quickly identify the nature of the file. It is essential for integrating tools in programming projects. For more on file types, check the external reference at File Extensions Info.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: text/x-component-pascal    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="text/x-component-pascal">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'text/x-component-pascal');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What is the text/x-component-pascal MIME type used for?

This MIME type represents source code files written in Component Pascal, a programming language derived from Oberon-2. It indicates to software that the content is plain text containing logic and syntax specific to this language, typically found in files with the .cp extension.

How do I configure Apache to serve Component Pascal files?

To ensure Apache serves these files with the correct headers, add the following line to your .htaccess file or main configuration: AddType text/x-component-pascal .cp. This helps client applications identify the file type correctly upon download or viewing.

How do I add support for this MIME type in Nginx?

In your Nginx configuration (usually inside mime.types), add the line text/x-component-pascal cp;. After saving the file, reload Nginx to ensure the server sends the correct Content-Type header for Component Pascal source files.

Why does the MIME type start with "x-"?

The x- prefix indicates that text/x-component-pascal is a non-standard or experimental type not officially registered with the IANA. It is a community-accepted convention used to distinguish Component Pascal files from standard text or other Pascal dialects.

Can I open text/x-component-pascal files in a web browser?

Yes, because the main type is text, most browsers will display the file's contents as raw plain text. However, browsers will not execute the code; they simply allow you to view the source syntax if the server is configured to display it inline.

What software opens files with this MIME type?

Since these are plain text files, they can be opened with any text editor such as Notepad++, Sublime Text, or VS Code. For compiling or specialized development, you would typically use the BlackBox Component Builder environment.

Is text/x-component-pascal the same as text/x-pascal?

No, text/x-pascal is generally used for standard Pascal or Delphi files (often .pas), while text/x-component-pascal is specific to the Component Pascal dialect. Using the distinct MIME type helps IDEs apply the correct syntax highlighting rules for the specific language version.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.