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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:44:55+00:00 2026-06-10T11:44:55+00:00

Here is the protocol: 1) I generate a text file online with PHP containing

  • 0

Here is the protocol:

1) I generate a text file online with PHP containing alphanumeric characters. Then I download it and note its size (from Properties menu).

2) I open the text file with Notepad++ and cut all the content in a new text file, then I save the new file (with the same name).

3) To my astonishment, even thought both files have the exact same text content, their size isn’t the same!

—TEST 1—

Downloaded file: 1529 Ko

New copy file: 1594 Ko

—TEST 2—

Downloaded file: 52 Ko

New copy file: 54 Ko


So what? Why am I posting this here? Because the file in question is available to my users for download on my website, and they can use it to replace a file in a game’s save. However, the game reacts to the new file by rejecting it, whilst the copied one (with the above protocol) works fine.

The only difference I see between both files is their size (slight difference as shown above) – but the content and the name is the same. Any idea why there is that size difference?

  • 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-06-10T11:44:57+00:00Added an answer on June 10, 2026 at 11:44 am

    This will most likely be newlines that are converted between unix (1 byte) and windows (2 bytes).

    As mentioned in the comments, it could also be encoding, but NotePad++ is pretty good at encoding. It’s also unlikely to account for the difference.

    You need to convert the “\r\n” to “\n” to get the smaller filesize. Here’s a page I just found with a few options: http://darklaunch.com/2009/05/06/php-normalize-newlines-line-endings-crlf-cr-lf-unix-windows-mac

    Another thingto watch for is a trailing “newline” which is not very obvious. Again, strip it out before doing your comparisson.

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

Sidebar

Related Questions

Just seeking confirmation here : apache Thrift protocol does not seem to support running
I am implementing a protocol library. Here a simplified description. The main thread within
Our client-server product has the protocol between them as XML over HTTP. Here, the
Here is what I am currently doing. PHP echo's out the recent post in
first of all here is my code: @protocol SearchTableViewControllerDelegate @required - (void)didSelectFileCardsContent:(FileCardsContent*)content; @end @interface
This is my first post here so please forgive any protocol errors. My question
First, please tell me if I'm not allowed to ask about this protocol here...
I'm setting up a net.tcp WCF service using instructions here: http://blogs.msdn.com/swiss_dpe_team/archive/2008/02/08/iis-7-support-for-non-http-protocols.aspx One of the
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>

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.