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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:19:11+00:00 2026-06-09T16:19:11+00:00

If I have a lexicographical sorted list of Java Strings [s1,s2,s3,s4, …., sn] ,

  • 0

If I have a lexicographical sorted list of Java Strings [s1,s2,s3,s4, ...., sn], and then convert each String into a byte array using UTF-8 encoding bx = sx.getBytes("UTF-8"), is the list of byte arrays [b1,b2,b3,...bn] also lexicographical sorted?

  • 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-09T16:19:12+00:00Added an answer on June 9, 2026 at 4:19 pm

    Yes. According to RFC 3239:

    The byte-value lexicographic sorting order of UTF-8 strings is the
    same as if ordered by character numbers. Of course this is of
    limited interest since a sort order based on character numbers is
    almost never culturally valid.

    As Ian Roberts pointed out, this applies for “true UTF-8 (such as String.getBytes will give you)”, but beware of DataInputStream‘s fake UTF-8, which will sort [U+000000] after [U+000001] and [U+00F000] after [U+10FFFF].

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

Sidebar

Related Questions

I have an array of strings, each one with a different length. e.g: s[0]
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
I have N strings that I want to divide lexicographic into M even-sized buckets
I have a list of strings: [song_1, song_3, song_15, song_16, song_4, song_8] I would
I have the following c# code that sorts a string in a lexicographical (alphabetical)
I have the following code, which splits up a Vector into a string vector
Have whats probably a simple problem with using parent in if and each statements
I have a dictionary d for which the keys are all strings. Now when
I'm trying to sort strings according to their names lexicographically. so I have an
So I am using dateString1.compareTo(dateString2) which does a lexicographic comparison with strings, based on

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.