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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:50:02+00:00 2026-06-01T11:50:02+00:00

When I run this program, I enter the username as dcole and the password

  • 0

When I run this program, I enter the username as "dcole" and the password "test" but when I enter them they return with "ÿûÿû ÿûÿû'ÿýÿûÿýdcole" and "ÿþÿþ ÿþÿþ'ÿütest". Here’s the code:

clientoutput.write("Please enter your username: ".getBytes("UTF-8"));
clientoutput.flush();

String username = clientinput.readLine();
out("Client " + clientip + " logged in as " + username);

String askforpass = "Please enter the password for " + username + ": ";
clientoutput.write(askforpass.getBytes());
clientoutput.flush();

String password = clientinput.readLine();

out(password);

Console:

Client connected with the IP /127.0.0.1
Client /127.0.0.1 logged in as ÿûÿû ÿûÿû'ÿýÿûÿýdcole ÿþÿþ ÿþÿþ'ÿütest
  • 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-01T11:50:04+00:00Added an answer on June 1, 2026 at 11:50 am

    If the input stream was pure UTF-8, then “dcole” and “test” would be unlikely to be garbled. (They would be fine if you used Latin-1 or ASCII to decode the bytes, and many other charsets as well.) Indeed you are seeing the expected characters, but with extra rubbish in front of it.

    I suspect that the client is actually preceding the username and password with some extra bytes. In other words, it is not sending simple text – it is sending messages in some protocol that you haven’t described.

    In fact, I think that this SO Question might explain your problem: Odd Behavior when Connecting to my Program

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

Sidebar

Related Questions

I need to run this line from my c++ program: java -jar test.jar text1
I am attempting to compile and run a test C program in Xcode. This
I wrote this C program for Win32/c compiler but while i'm trying run this
Here is a sample run of this program, assuming that the executable file is
This program takes 2 numbers from user input, asks them whether they'd like to
In order to test bool i/o, I tried to run this short program: #include
Im doing C homework and trying to get this program to run, but I
when I run this program, it print NameError global name 'viewAll' is not defined
I have run this program before and it worked fine. Then I added the
This program I use has it's own variables to set when you run it,

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.