text - Different characters take more/less data? -


i working on personal project , i'm wondering if characters take more data in text file others. need choose character seperate items in file, if 0 uses less bytes ! or something, best that. know characters have ascii value, lower ascii value mean character can stored in fewer bytes?

this might incredibly stupid question, don't see information on topic online came here check.

thanks!

it depends on character set using whether or not 1 character take more space another. character sets variable-width [1]. utf-8 1 such character set. using utf-8 example, standard ascii characters 1 byte in width, whereas extended ascii characters start take multiple bytes (up 6) [2].

in example, of '0' , '!': both standard ascii , therefore both 1 byte in width in utf-8.

references:

  1. variable width encoding (wikipedia)
  2. utf-8 description (wikipedia)

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -