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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:10:05+00:00 2026-05-17T20:10:05+00:00

I print to the standard output some characters from a wide UTF-8 range in

  • 0

I print to the standard output some characters from a wide UTF-8 range in a Java application. My console is configured for UTF-8 support. My problem is that sometimes, when I decide to print 10 characters for example, I see a number of character which is less then 10.

I think this is due to the console which interprets some characters. Are there some unicode character which can be interpreted like: erase the previous character ? Is it possible to exclude them from the ouput (what are the codepoints of these characters)?

  • 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-17T20:10:06+00:00Added an answer on May 17, 2026 at 8:10 pm

    Using carriage return or the backspace character you can get results like you describe. This little test program for instance…

    public class Test {
        public static void main(String... args) {
            System.out.println("abc\rdef\u0008g");
        }
    }
    

    …prints in my terminal (ubuntu)

    $ java Test
    deg
    $
    

    \r is carriage return, and \u0008 represents the backspace character. (Carriage return sends the cursor back to the first column, and backspace sends it back one column.)


    To remove all these, so called “control characters” you could do:

    myString = myString.replaceAll("\\p{Cntrl}", "");
    

    from the docs:

    \p{Cntrl}      A control character: [\x00-\x1F\x7F]

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

Sidebar

Related Questions

i've a Java program that print out some text output. Actually my simple PrintOutput
Can a Java Applet able to print out text/html easily to standard printer driver(s)
First some background. I have a batch-type java process run from a DOS batch
I'm trying to redirect some of the standard output to a text file, and
I used this line to execute a python script from a java application: Process
How can I read from standard input and write to standard output. System.Diagnostics.Process.StandardInput's MSDN
Is there really no way to print an ascii string in assembly to standard
I'm using WWW::Mechanize to do some standard website traversal, but at one point I
Is there any possibility to achieve different redirections for standard output like printf(3) for
I want to make some html output look like this... Tag1 blah blah blah

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.