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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:51:20+00:00 2026-05-24T06:51:20+00:00

Can UTF-8 string contain zerobytes? I’m going to send it over ascii plaintext protocol,

  • 0

Can UTF-8 string contain zerobytes? I’m going to send it over ascii plaintext protocol, should I encode it with something like base64?

  • 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-24T06:51:21+00:00Added an answer on May 24, 2026 at 6:51 am

    Yes, the zero byte in UTF8 is code point 0, NUL. There is no other Unicode code point that will be encoded in UTF8 with a zero byte anywhere within it.

    The possible code points and their UTF8 encoding are:

    Range              Encoding  Binary value
    -----------------  --------  --------------------------
    U+000000-U+00007f  0xxxxxxx  0xxxxxxx
    
    U+000080-U+0007ff  110yyyxx  00000yyy xxxxxxxx
                       10xxxxxx
    
    U+000800-U+00ffff  1110yyyy  yyyyyyyy xxxxxxxx
                       10yyyyxx
                       10xxxxxx
    
    U+010000-U+10ffff  11110zzz  000zzzzz yyyyyyyy xxxxxxxx
                       10zzyyyy
                       10yyyyxx
                       10xxxxxx
    

    You can see that all the non-zero ASCII characters are represented as themselves while all mutibyte sequences have a high bit of 1 in all their bytes.

    You may need to be careful that your ascii plaintext protocol doesn’t treat non-ASCII characters badly (since that will be all non-ASCII code points).

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

Sidebar

Related Questions

Let's say I have a string that can contain any UTF-16 characters, but I
So I have a UTF-8 encoded string which can contain full-width kanji, full-width kana,
Can you use a UTF-8 string as the Arguments for a StartInfo? I am
I've found a Perl regexp that can check if a string is UTF-8 (the
Can base64 encoding applied to multibyte utf-8 characters ? How base64 encoded string is
You can write UTF-8/16/32 string literals in C++11 by prefixing the string literal with
A JSON string can contain the escape sequence: \u four-hex-digits, which are two octets.
PHP's str_replace() was intended only for ANSI strings and as such can mangle UTF-8
how can I save all files in a directory using utf-8? There is a
Where can I set it? I need files to be encoded in UTF-8 by

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.