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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:49:42+00:00 2026-05-16T07:49:42+00:00

I found this in the wikipedia article on utf-8: Sorting of UTF-8 strings as

  • 0

I found this in the wikipedia article on utf-8:

Sorting of UTF-8 strings as arrays of unsigned bytes will produce the same results as sorting them based on Unicode code points.

That would lead me to believe that for comparison purposes (sorting, binary search, etc) that comparing two byte arrays (i.e. byte-by-byte like memcmp) of utf-8 encoded strings would give the same results as comparing the actual unicode strings.

Is this true?

  • 1 1 Answer
  • 3 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-16T07:49:43+00:00Added an answer on May 16, 2026 at 7:49 am

    It depends on what you mean by “comparing the actual Unicode strings”.

    If you’re just going to compare the code points (as 32-bit numbers) instead of the UTF-8 encoded code points, then the answer is yes: that will give the same results. The mapping from code points to UTF-8 encoded bytes is one-to-one.

    If you’re going to do a proper Unicode string comparison, instead of bytewise comparison of the UTF-8, the answer is no. In Unicode, there can be different ways to represent the same character. For example, é can be represented in (at least) two ways:

    • U+00e9 (LATIN SMALL LETTER E WITH ACUTE), or
    • U+0065 (LATIN SMALL LETTER E) followed by U+0301 (COMBINING ACUTE ACCENT).

    A properly written Unicode comparison function will consider these two to be identical.

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

Sidebar

Related Questions

On this Wikipedia entry I found out that ITU Telecommunication Standardization Sector (ITU-T) is
I found this piece of code on Wikipedia. #include <stdio.h> int main(void) { int
I found this: http://en.wikipedia.org/wiki/MySQL_DataController which lead me to this: https://launchpad.net/datacontroller It looks like a
I've found this pseudocode from Wikipedia of Euclid's extended Algorithm, but I don't know
I found this piece of Java code at Wikipedia that is supposed to shuffle
I'm looking at this wikipedia article: http://en.wikipedia.org/wiki/Day_length http://en.wikipedia.org/wiki/Sunrise_equation Anybody had experience calculating Sunrise/Sunset times
int stxval = 0x02; //found this value on wikipedia string mystring = Hello; StringBuilder
I'm parsing a text file made from this Wikipedia article , basically I made
Found this while reading the Neo4j manual, specifically here , I found the sentence:
Found This: tyty stack, Social Icons not working with Infinite Scrolling on Wordpress I'm

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.