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 919757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:35:55+00:00 2026-05-15T18:35:55+00:00

I have read a few links on the topic of file formats and encoding,

  • 0

I have read a few links on the topic of file formats and encoding, but how is it done?

If all data is binary, what splits data into different file formats? What exactly does encoding the data involve? How is it done?

  • 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-15T18:35:56+00:00Added an answer on May 15, 2026 at 6:35 pm

    The main ways to decide what format something is are by file extension or by MIME type – and less frequently by “magic numbers”.
    The file extension will be checked by an OS or Application to decide what to do with it (which app to run it in, or which part of code to execute for it).

    MIME types are used where an extension (or filename) isn’t always applicable – for example, when downloading a file over HTTP, the URI for a file might be something like ~.php?id=12973. The filetype cannot be determined from ths alone, but the HTTP protocol will send a “Content-Type” definition to say what format the file is, and the browser will handle it correctly. eg: a Content-Type: image/png would force the browser to pass the file to some PNG decoding function.

    When the application knows what the file format is, it’ll pass the data to code which is written specifically for that format. If the program doesn’t have code to read a format, it will fail to read it.

    How a file is encoded is specific to the file. Most standard formats will have a specification to describe their binary encoding, and any application reading that file type must implement code to match the specification. (Although this is usually done by using a library which already does the reading for you).

    To give an example of how binary encodings work, consider an image. The specification might say that bytes 10-13 signify the width of the image, and bytes 14-17 signify the height of the image. In order to read those pieces of the information from the file, the code must explicitly read the correct size data at the correct locations indicated by the spec. EG: fseek(f, 10, SEEK_SET); fread(&width, 4, 1, f); //Read 4 bytes at location 10 into "width"). I think your confusion is “what separates pieces of data in binary files?” (ie, in text files, this can be done by new lines, spaces, comma-separated values (CSV), etc). The answer is: usually the size of the data will determine where it ends – a specification will say what the binary type of each field is (perhaps it may say int32, indicating 32 bits/4 bytes).

    Other than that, there can be ambiguities in file formats, but usually happens with text files, where the text inside can be read to determine the format. This isn’t always applicable, because often a text file will simply have the extension “.txt”, so it can be unknown to the application what the character encoding of the text is. (This was, and still is a problem for applications which do not use unicode).

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

Sidebar

Related Questions

I have read few articles about table partioning but still I am bit confused
I need to create an excel file via C#. I have read a few
I'm fairly new to working with relational databases, but have read a few books
I have read quite a few selcet+update questions in here but cannot understand how
I've read a few posts on this but I'm still confused. I have this
I've read quite a few links about the problem but i can't grasp why
Getting more and more familiar with DI but I still have few niggles. Read
Although I have read a few previously answered questions regarding a similar issue, I
Hi I read a few post on this topic, lets say I want to
I've read a few posts on the topic, . Here is my strategy; I

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.