It works! Thank you so much Michael!!
Long live Toronto!

Le 5 oct. 2009 à 21:14, Michael Glavassevich a écrit :

Try calling flush() on the Writer.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com

E-mail: mrgla...@apache.org

Yannis Haralambous <yannis.haralamb...@telecom-bretagne.eu> wrote on 10/05/2009 02:13:00 PM:

> Le 5 oct. 2009 à 17:23, Michael Glavassevich a écrit :

>
> Wrap System.out in an OutputStreamWriter:
>
> Writer writer = new OutputStreamWriter(System.out, "UTF-8");
>
> and call the write() methods on this Writer. Always do this when you
> want a specific encoding. Relying on the default encoding is a bug
> waiting to happen even if you think you can control it.
>
> Thanks.

>
> Thank you for the advice

> After several attempts, when writing
>
>     public void characters(char[] ch, int start, int length) throws
> SAXException

>     {
> try
> {
> OutputStream out=System.out;
> OutputStreamWriter writer = new OutputStreamWriter(out, "UTF-8");
> String s = new String(ch, start, length);
>        writer.write(s);
>        }
> catch (IOException e) {}
>     }
>
> the file compiles, but I don't get any output… What is wrong???


--
+-----------------------------------------------------------------------+
| Yannis Haralambous, Ph.D.      yannis.haralamb...@telecom-bretagne.eu |
| Directeur d'Études                      http://omega.enstb.org/yannis |
|                                               twitter : y_haralambous |
|                                             Tel. +33 (0)2.29.00.14.27 |
|                                             Fax  +33 (0)2.29.00.12.82 |
| Département Informatique                                              |
| Télécom Bretagne                                                      |
| Technopôle de Brest Iroise, CS 83818, 29238 Brest Cedex 3, France     |
| Coordonnées Google-Earth : 48°21'31.57"N 4°34'16.76"W                 |
+-----------------------------------------------------------------------+
                            ...pour distinguer l'extérieur d'un aquarium,
                                           mieux vaut n'être pas poisson

                           ...the ball I threw while playing in the park
                                          has not yet reached the ground

              Es gab eine Zeit, wo ich nur ungern über Schubert sprechen,
           nur Nächtens den Bäumen und Sternen von ihm vorerzählen mögen.

BEGIN:VCARD
VERSION:3.0
N:Haralambous;Yannis;;;
FN:Yannis Haralambous
ORG:Enseignant-chercheur\, TELECOM Bretagne;
EMAIL;type=INTERNET;type=WORK;type=pref:yannis.haralamb...@telecom-bretagne.eu
TEL;type=WORK;type=pref:+33 229001427
TEL;type=CELL:+33 607981626
TEL;type=WORK;type=FAX:+33 229001282
item1.ADR;type=WORK;type=pref:;;Département Informatique\, TELECOM Bretagne\, CS 83818;Brest Cedex 3;;29238;France
item1.X-ABADR:fr
X-ABUID:CD3E6B27-C13F-40A4-B2F7-8393D5CE6493\:ABPerson
END:VCARD

Reply via email to