My java chat doesn't show more characters (�,�,�,�,�),any help?

Hello!I'm studing two java source:
//Importo i package necessari
import java.net.*;
import java.io.*;
public class TCPClient {
public void start()throws IOException {
//Connessione della Socket con il Server
Socket socket = new Socket("localhost", 7777);
//Stream di byte da passare al Socket
DataOutputStream os = new DataOutputStream(socket.getOutputStream());
DataInputStream is = new DataInputStream(socket.getInputStream());
BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Per disconnettersi dal Server scrivere: QUIT\n");
//Ciclo infinito per inserimento testo del Client
while (true) {
System.out.print("Inserisci: ");
String userInput = stdIn.readLine();
if (userInput.equals("QUIT"))
break;
os.writeBytes(userInput + '\n');
System.out.println("Hai digitato: " + is.readLine());
//Chiusura dello Stream e del Socket
os.close();
is.close();
socket.close();
public static void main (String[] args) throws Exception {
TCPClient tcpClient = new TCPClient();
tcpClient.start();
//end
and
//Importo i package
import java.net.*;
import java.io.*;
//Creazione di una classe per il Multrithreading
class ServerThread extends Thread {
private Socket socket;
public ServerThread (Socket socket) {
this.socket = socket;
//esecuzione del Thread sul Socket
public void run() {
try {
DataInputStream is = new DataInputStream(socket.getInputStream());
DataOutputStream os = new DataOutputStream(socket.getOutputStream());
while(true) {
String userInput = is.readLine();
if (userInput == null || userInput.equals("QUIT"))
break;
os.writeBytes(userInput + '\n');
System.out.println("Il Client ha scritto: " + userInput);
os.close();
is.close();
System.out.println("Ho ricevuto una chiamata di chiusura da:\n"
               + socket + "\n");
socket.close();
catch (IOException e) {
System.out.println("IOException: " + e);
//Classe Server per attivare la Socket
public class TCPParallelServer {
public void start() throws Exception {
ServerSocket serverSocket = new ServerSocket(7777);
//Ciclo infinito di ascolto dei Client
while(true) {
System.out.println("In attesa di chiamate dai Client... ");
Socket socket = serverSocket.accept();
System.out.println("Ho ricevuto una chiamata di apertura da:\n" + socket);
ServerThread serverThread = new ServerThread(socket);
serverThread.start();
public static void main (String[] args) throws Exception {
TCPParallelServer tcpServer = new TCPParallelServer();
tcpServer.start();
but this client/server program doesn't display more characters such ��� ect ect,how i do to mode this code for a correct output?
Greetings

ok,i'm trying but now to test my source i've to find
the readChar in BufferedWriter,i've see that in
BufferedWriter readChar is read() but this don't
work,the editor gives me an error that says"found int
required char" possible loss of precision.I can't
read the javadocs corretly,i'm a newbie.
I assume that you mean BufferedReader and that your use of BufferedWriter is a typo.
From your first post I assumed you were reading and writing lines not the individual characters but no problem. Yes, one should use the read() method to read an individual character and if the value returned is not -1 (which signifies end of file) then it can be cast to a char using
char ch = (char)br.read();

Similar Messages

  • Syncing iphone and can't seem to transfer audiobooks that i have put in a playlist.  Sync menu doesn't show all playlists.  Help

    syncing iphone and can't seem to transfer audiobooks that i have put in a playlist.  Sync menu doesn't show all playlists.  Help

    I have the same problem with podcast playlists.  When I go to the music window in my iPhone devices section, the playlists I have created on my macbook pro in iTunes do not appear as an option to sync with the iPhone.  I know some web radios streams, like the BBC, won't transfer because of compatibility issues, but the playlists of podcasts that I have created consist entirely of podcasts downloaded from the podcasts section on the iTunes Music Store.  They used to show up and sync properly before I upgraded to OS 5.1.1, but now they don't.
    Does anyone have a fix and am I right in surmising that the cause is a glitch in OS 5.1.1?

  • My MacBook Pro spits out a CD within 30 seconds.  It doesn't show up anywhere.  Help please.

    My MacBook Pro spits out a CD within 30 seconds.  It doesn't show up anywhere.  Help please.

    You can try a commercial lens cleaner.  They are sold everywhere for little expense.
    http://www.walmart.com/ip/Memorex-32020022912/15120287

  • HT5312 The option to reset security information tab isn't showing up for me, is there I way that I can make it show up. I have a rescue email address and it still doesn't show up. Please help!

    The option to reset my security information tab is not available for me, I have a rescue email address in place and it still doesn't show up. Please help!

    You need to ask Apple to reset your security questions; ways of doing so include clicking here and picking a method for your country, and filling out and submitting this form.
    (96335)

  • I have connected a new (set up for mac) seagate external HD and although file sharing is turned on the HD doesn't show up on any of the other computers on our network??????  Please help!!!!!

    I have connected a new (set up for mac) seagate external HD and although file sharing is turned on the HD doesn't show up on any of the other computers on our network??????  Please help!!!!!

    If the HD is setup for Mac and plugged into the AE.. with file sharing on, it should work.
    Try manually mounting the disk.
    In finder use go, connect to server, and type in AFP://AEName or AFP://AEIPaddress.. where you replace what I wrote with the actual name or actual IP.
    Later versions of Mac OS.. like ML for some strange reason have their preferences set by default to not show network drives.. change finder preference to see everything.

  • How come now every time i throw something into the recycle bin it asks for my password and when I do it doesn't show in my bin help please!

    How come now every time i throw something into the recycle bin it asks for my password and when I do it doesn't show in my bin help please!

    You're throwing away files that either don't belong to you or are in a folder that doesn't belong to you. Since your user account has Administrator privileges, it just ask you for authentication, else it would forbid the operation.
    To better understand the concept, select one of your files from your home directory and press Control-I. In the info window, check the Sharing & Permissions section at the bottom. Do the same with one of the files that asks for the password.

  • Transition doesn't show up. Any ideas?

    I put a transition in between two non video clips but the transition doesn't show up. Any ideas? I've adjusted the time every which way for both clips and the transition itself as well as tried other transitions. Thanks!

    Locate the downloaded file:
    1. try to launch the file and see if you get prompts.
    2. drag the downloaded file to applications folder

  • Mac Mail Issue: I was having trouble sending to hotmail accounts from my Earthlink account, they had me go into Mac Mail preferences and make changes, now Mac Mail doesn't work AT ALL - any help changing the settings back to correct Mac Mail settings? I c

    I was having trouble sending to hotmail accounts from my Earthlink account, they had me go into Mac Mail preferences and make changes (because they claimed it was Mac Mail's fault, even though the hotmail error code said it's because Earthlink is blocked by hotmail), now Mac Mail doesn't work AT ALL - any help changing the settings back to correct Mac Mail settings? I can provide a transcript of the entire tech chat session, if that will help...

    both apostrophes are used correctly, thanks
    doesn't = does not (this is called a contraction)
    it's = it is
    Mac Mail's fault = possessive
    any help with the actual issue? thanks!

  • I can't seems to print using my macbook air with hp series printers. When I plug the printer via usb to my system, the printer was recognized and installed. But when i send a doc for printing, it doesn't print all . Any help?

    i can't seems to print using my macbook air with hp series printers. When I plug the printer via usb to my system, the printer was recognized and installed. But when i send a doc for printing, it doesn't print all . Any help?

    Greetings,
    Here's a direct link to the drivers you need, they should work perfectly for your situation.

  • White screen on a 3rd gen nano?  Doesn't want to reset, any help

    White screen on a 3rd gen nano?  Doesn't want to reset, any help?

    It fast forwards. Just hold down the right-arrow key and it fast-forwards while you are holding it down. That's how I got through all the O.J. stories on my downloaded news podcasts.
    doug

  • DVDStudioPro doesn't show graphic subtitles any more

    My DVD Studio Pro 4.2.2 has shown graphic subtitles (tifs) until kind of recently.
    Even earlier created projects doesn't show them any more.
    What happend. Has anybody else noticed this thing?
    How can I make them visible again?
    I'm on OSX 10.6.8

    There shouldn't be a need to mouse over the tab to see what the title is. The space is wasted otherwise, so why not display the title there whether or not the menu bar is also displayed?
    I attached a picture showing exactly what I'm talking about, excuse the quick ms paint job.

  • My java applet doesn't show up in Firefox

    We have a new Mac running OSX 10.8.4 and installed with Firefox 21.0 and Java 7 update 25. The web applet/plugin doesn't show up in Firefox, if we go to java.com and do the tests it just comes back 'We are unable to verify if Java is currently installed and enabled in your browser'
    The same test in Safari comes back fine and shows Java 7 Update 25 installed and working.
    The plugin does not show at all in Firefox add-ons. Browser functionality is enabled in the main Java control panel.
    We have completely removed and reinstalled both Firefox and Java.
    Thanks

    Hi iNerd
    Thanks for the link but neither of the two options that are discussed are presented to the user. Instead the user just gets the message 'We are unable to verify if Java is currently installed and enabled in your browser'. I know it is installed and enabled for general browser use as it all works fine in Safari. We would obviously just use Safari except the key site the user needs to link to works better with Firefox.

  • Safari doesn't show Chinese characters in a specific site?

    Hi all,
    I've just found a weird thing that Safari doesn't show Chinese character in this site.
    http://blog.bcxstudio.net/
    It works in Firefox (Mac and win), Chrome (mac and win), IE 6-9, Safari for Mac, but not Safari on Windows.
    However, when I browse other websites like Yahoo hong kong and Apple HK. There is no problem.
    http://hk.news.yahoo.com
    http://www.apple.com/hk
    My best guess is that the site may uses some fonts (CSS3 @font-face?) that safari did not support.
    Anyone knows what happened?
    I am on Windows 7, Safari for Windows 5.0.2 (7533.18.5)
    Thank you!

    That's a bit odd ... I'm getting the opposite effect at the moment on my XP SP3. I'm not seeing the text in IE 8 (I don't think I've got the International character sets installed for my XP Pro), but they show fine in my Safari 5.0.2.
    Are you still seeing the effect at your end at the moment, b?

  • Administrator (ver.10.1.2.48.18) doesn't show greeks characters correctly

    Hi everybody,
    I re-install on my new pc, from the file as_windows_x86_bi_tools_101202.zip the following version of Discoverer Administrator: 10.1.2.48.18
    I need to see both English and Greek languages and when I installed the software (from the installer) I chose both these language.
    Inside the registry I have the following NLS_LANG: GREEK_GREECE.EL8MSWIN1253
    So, now my problem is this: when I open the Administrator, after the credentials (login, etc...) and I try to open a business area, if this last one is written with greek characters I see black rectangles, but once opened I see the correct label in Greek.
    But all the Hierarchies' and summaries' labels are black rectangles (if written in Greek) as the formulas inside the new items.....
    On the file system I added the following fonts:
    ALBANWTJ.ttf
    ALBANWTK.ttf
    ALBANWTS.ttf
    ALBANWTT.ttf
    ALBANYWT.ttf
    under the paths:
    1. C:\Oracle\Oracle_Homes\OBI_Tools_10g\jre\1.4.2\lib\fonts
    2. C:\Oracle\Oracle_Homes\OBI_Tools_10g\jdk\jre\lib\fonts
    3. C:\Program Files\Java\jre1.5.0_15\lib\fonts
    but my problem didn't still resolve
    Anybody had the same problem with another language (russian, chinese for example) ???
    Any help or hint will be appreciated
    Alex

    Try anything here that you haven't already tried:
    iPhone, iPad, or iPod not recognized in iTunes for Windows - Apple Support

  • When trying to update apps it asks for account password but it doesn't show my account. Help!

    When trying to update apps it asks for account password but it doesn't show my account ID, it shows my dad's. How can I fix this so I can sign in?

    It sounds like the apps were purchased using your dads account, so they will have to be updated using that account.

Maybe you are looking for

  • Multiply price list per Business partner

    Hi does any one come accross information on how i assign Business partner 2 or more price list basicly what i want to do is  to give diffrent factors (price list) for diffrent Group of items , so each BP will have diffrent disscount for each group of

  • Backing up iPad apps purchased with two accounts?

    For a recent sync, I "transferred purchases" from my iPad to iTunes and subsequently synced it to my iMac with my personal AppleID. Before syncing, my iPad had apps purchased with two separate AppleIDs on it. Upon doing a restore for the iOS5 upgrade

  • Final Cut Pro X/Canon Vixia Import Time Different

    Hi, I have an annoying issue that I have not been able to figure out. I use a Canon Vixia M41 camera to record family videos in AVCHD. I usually import them directly off the card into Final Cut Pro X by first making an archive to store on another har

  • How to get parameter from URL - part II

    Is there a way to assign a value of JavaScript variable to JSF variable?, something like <h:commandButton value="Send" actionListener ="#{myBean.myAction}"  <f:attribute name="source" value="<some JavaScript variable>"/> </h:commandButton>Here is my

  • UC&UC Combined Upgrade and Unicode Conversion from 4.6c to Netweaver 7.01

    Hi Gurus, I need to do (UC&UC) from 4.6c to Netweaver 7.01, after reading SAP guide still unsure about exact STEPS how to execute this, is there someone who has done, and pl. can explain STEPS how exactly to do that. Thanks for your help in advance s