IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java Discussion :

Erreur Config.getCharSet() java


Sujet :

Java

  1. #1
    Nouveau membre du Club
    Inscrit en
    Novembre 2003
    Messages
    166
    Détails du profil
    Informations forums :
    Inscription : Novembre 2003
    Messages : 166
    Points : 39
    Points
    39
    Par défaut Erreur Config.getCharSet() java
    Bonjour,
    j'ai un fichier ebcdic qui contient des zones paquets à convertir en ascii.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
     
    import java.util.*;
    import java.io.*;
    import java.io.IOException;
    import java.io.StringReader;
     
    public class Translate {
     
            private static final int SIZE = 95;
     
            private static final int ASCII[] = {
                    0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028,
                    0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
                    0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038,
                    0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
                    0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048,
                    0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
                    0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058,
                    0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
                    0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068,
                    0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
                    0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078,
                    0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e
            };      
            private static final int EBCDIC[] = {
                    0x0040, 0x005a, 0x007f, 0x007b, 0x005b, 0x006c, 0x0050, 0x007d, 0x004d,
                    0x005d, 0x005c, 0x004e, 0x006b, 0x0060, 0x004b, 0x0061,
                    0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8,
                    0x00f9, 0x007a, 0x005e, 0x004c, 0x007e, 0x006e, 0x006f,
                    0x007c, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 0x00c8,
                    0x00c9, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6,
                    0x00d7, 0x00d8, 0x00d9, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
                    0x00e8, 0x00e9, 0x00ad, 0x00e0, 0x00bd, 0x005f, 0x006d,
                    0x0079, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088,
                    0x0089, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096,
                    0x0097, 0x0098, 0x0099, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
                    0x00a8, 0x00a9, 0x00c0, 0x006a, 0x00d0, 0x00a1
            };      
     
     
       public final static int translateByte(int i) {
          String thisCharSet = Config.getCharSet();
          if (thisCharSet.equals("EBCDIC")) {
              for (int j = 0; j<SIZE; j++) {
                  if (i == ASCII[j]) {
                      return EBCDIC[j];
                  }
              }               
          }       
          return i;
       }
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    ebcdic.java:6: class Translate is public, should be declared in a file named Translate.java
    public class Translate {
           ^
    ebcdic.java:46: cannot resolve symbol
    symbol  : variable Config  
    location: class Translate
          String thisCharSet = Config.getCharSet();
                               ^
    2 errors
    Merci

  2. #2
    Membre habitué
    Profil pro
    Inscrit en
    Octobre 2005
    Messages
    104
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2005
    Messages : 104
    Points : 140
    Points
    140
    Par défaut
    Bonjour,
    Les 2 messages d'erreur sont explicites à condition de savoir lire l'anglais :
    1) Il faut renommer le fichier ebcdic.java en Translate.java ou bien changer le nom de la classe Translate en ebcdic.
    2) Config n'est pas déclaré : est-ce une variable ou une autre classe qui ne serait pas dans un fichier portant le nom correct ?
    Prends le temps de lire un livre sur Java.

  3. #3
    Nouveau membre du Club
    Inscrit en
    Novembre 2003
    Messages
    166
    Détails du profil
    Informations forums :
    Inscription : Novembre 2003
    Messages : 166
    Points : 39
    Points
    39
    Par défaut
    maintenant j'ai ce message

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
     
    Translate.java:47: cannot resolve symbol
    symbol  : variable Config  
    location: class Translate
          String thisCharSet = Config.getCharSet();
                               ^
    1 error
    quelqu'un à une idée

Discussions similaires

  1. [TP 7] Exécution de TPX.EXE : erreur CONFIG.NT
    Par essaidovski dans le forum Turbo Pascal
    Réponses: 9
    Dernier message: 05/01/2007, 22h53
  2. ERREUR UPDATE Avec java et oracle
    Par gloglo dans le forum JDBC
    Réponses: 7
    Dernier message: 20/10/2006, 09h35
  3. Erreur de connexion : java RMI & linux
    Par pedouille dans le forum API standards et tierces
    Réponses: 2
    Dernier message: 16/05/2006, 20h04
  4. Erreur appel fonction java d'une jsp
    Par itachi38 dans le forum Servlets/JSP
    Réponses: 3
    Dernier message: 29/04/2006, 16h51
  5. Lecture d'un fichier XML de config avec Java
    Par cofy dans le forum Format d'échange (XML, JSON...)
    Réponses: 6
    Dernier message: 31/01/2006, 15h54

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo