Contenu | Rechercher | Menus

Annonce

L'équipe des administrateurs et modérateurs du forum vous invite à prendre connaissance des nouvelles règles.
En cas de besoin, vous pouvez intervenir dans cette discussion.

Ubuntu 18.04 LTS
Ubuntu-fr propose des clés USB de Ubuntu et toutes ses « saveurs » ainsi qu'un magnifique t-shirt pour cette toute nouvelle version d'Ubuntu !

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 22/05/2018, à 09:39

CodeRom

[Résolu] Pango-WARNING :Invalid UTF-8 string passed to pango

Bien le bonjour , me re voila avec mes éternels problème de programmation smile

Aujourdh'ui c'est sur GTK que je bloque avec une erreur que je n'arrive a fixer et surtout je sais pas d'où elle vient.

L'erreur en cause est dans le titre mais je la remet ici en entière :  Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()

Un précision desfois le programme compile et l'affichage ce fait normalement sans aucun retour d'erreur ds la console, puis desfois affichage foireux et erreur dans la console, c'est donc la roulette russe........

Alors excusez moi d'avance je vais vous fournir l'ensemble du code source qui n'est pas très long, mais un peu quand même.Je n'ai pas d'autre solution ne sachant pas d'où viens l'erreur.

C'est codé en language C avec la lib GTK et sont module GTK-extra, le programme cré un tree view et le remplis suite a l'execution de la command "ps -axu", c'est donc un moniteur systeme statique.

le main.c

#include <stdlib.h>
#include <string.h>
#include <gtk-2.0/gtk/gtk.h>
#include <gtkextra/gtkextra.h>
#include <gtkextra/gtksheet.h>

#include "../includes/constantes.h"
#include "../includes/read_write.h"

int main (int argc, char *argv[])
{
    char *buffer = NULL;
    char *buffer_line = NULL;

    FILE *result_of_the_cmd = NULL;

    GtkWidget *main_window = NULL;
    GtkWidget *view = NULL;

    gtk_init(&argc, &argv);

    buffer = malloc(40000 * sizeof(char*));
    if(buffer == NULL)
    {
        perror("malloc() ");
        exit(-1);
    }

    buffer = execute_command(result_of_the_cmd);

    //printf("%s", buffer_line);


    main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size(GTK_WINDOW(main_window), 1024, 768);
    gtk_window_set_title(GTK_WINDOW(main_window), "Task Manager");

    g_signal_connect(G_OBJECT(main_window), "destroy", G_CALLBACK(gtk_main_quit), NULL);

    view = create_view_and_model(buffer, buffer_line, result_of_the_cmd);

    gtk_container_add(GTK_CONTAINER(main_window), view);

    gtk_widget_show_all(main_window);

    free(buffer);

    gtk_main();

    return EXIT_SUCCESS;
}


GtkWidget *create_view_and_model(char *buffer, char * buffer_line, FILE *result_of_the_cmd)
{
    GtkTreeViewColumn   *col;
    GtkCellRenderer     *renderer;
    GtkWidget           *view;
    GtkTreeModel        *model;


    view = gtk_tree_view_new();

    /* column 1 */

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "USER");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the first name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", USER);

    g_object_set(GTK_OBJECT(renderer), "width", 100, NULL);



    /* --- Column #2 --- */

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "PID");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the last name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", PID);

    /* set 'weight' property of the cell renderer to bold print (we want all last names in bold) */
    g_object_set(renderer, "weight", PANGO_WEIGHT_NORMAL, "weight-set", TRUE, NULL);

    g_object_set(GTK_OBJECT(renderer), "width", 100, NULL);


    /* column 3 */

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "%CPU");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the first name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", CPU);

    g_object_set(GTK_OBJECT(renderer), "width", 100, NULL);


    /* column 4 */

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "%MEM");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the first name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", MEM);
    g_object_set(GTK_OBJECT(renderer), "width", 100, NULL);


    /* column 5 */

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "VSZ");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the first name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", VSZ);

    g_object_set(GTK_OBJECT(renderer), "width", 100, NULL);


    /* column 6 */

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "RSS");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the first name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", RSS);

    g_object_set(GTK_OBJECT(renderer), "width", 100, NULL);


    /* column 7 */

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "TTY");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the first name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", TTY);

    g_object_set(GTK_OBJECT(renderer), "width", 100, NULL);



    /* column 8 */

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "STAT");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the first name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", STAT);

    g_object_set(GTK_OBJECT(renderer), "width", 100, NULL);


    /* column 9 */

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "START");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the first name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", START);

    g_object_set(GTK_OBJECT(renderer), "width", 100, NULL);


    /* column 10 */

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "TIME");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the first name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", TIME);

    g_object_set(GTK_OBJECT(renderer), "width", 300, NULL);

    /* column 11*/

    col = gtk_tree_view_column_new();

    gtk_tree_view_column_set_title(col, "COMMAND");

    /* pack tree view column into tree view */
    gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);

    renderer = gtk_cell_renderer_text_new();

    /* pack cell renderer into tree view column */
    gtk_tree_view_column_pack_start(col, renderer, TRUE);

    /* connect 'text' property of the cell renderer to model column that contains the first name */
    gtk_tree_view_column_add_attribute(col, renderer, "text", COMMAND);

    g_object_set(GTK_OBJECT(renderer), "width", 300, NULL);



    model = create_and_fill_model(result_of_the_cmd);

    gtk_tree_view_set_model(GTK_TREE_VIEW(view), model);

    g_object_unref(model); /* destroy model automatically with view */

    gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(view)), GTK_SELECTION_NONE);


    return view;
}


GtkTreeModel *create_and_fill_model(FILE *result_of_the_cmd)
{
    GtkTreeStore  *treestore;
    GtkTreeIter    toplevel;

    char *buffer = NULL;

    treestore = gtk_tree_store_new(11, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
                                   G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);

    /* Append a top level row and leave it empty */
    gtk_tree_store_append(treestore, &toplevel, NULL);

    /* 1ere ligne */

    buffer = read_line(buffer, result_of_the_cmd, 2, 0, 5);
    gtk_tree_store_set(treestore, &toplevel, USER, buffer , -1);

    buffer = read_line(buffer, result_of_the_cmd, 2, 13, 14);
    gtk_tree_store_set(treestore, &toplevel, PID, atoi(buffer) , -1);

    buffer = read_line(buffer, result_of_the_cmd, 2, 15, 19);
    gtk_tree_store_set(treestore, &toplevel, CPU, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 2, 21, 24);
    gtk_tree_store_set(treestore, &toplevel, MEM, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 2, 24, 31);
    gtk_tree_store_set(treestore, &toplevel, VSZ, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 2, 33, 37);
    gtk_tree_store_set(treestore, &toplevel, RSS, atoi(buffer), -1);

    buffer = read_line(buffer, result_of_the_cmd, 2, 38, 39);
    gtk_tree_store_set(treestore, &toplevel, TTY, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 2, 47, 49);
    gtk_tree_store_set(treestore, &toplevel, STAT, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 2, 52, 57);
    gtk_tree_store_set(treestore, &toplevel, START, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 2, 60, 64);
    gtk_tree_store_set(treestore, &toplevel, TIME, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 2, 65, 82);
    gtk_tree_store_set(treestore, &toplevel, COMMAND, buffer, -1);

    /* 2nd ligne */

    /* Append a second top level row, and fill it with some data */
    gtk_tree_store_append(treestore, &toplevel, NULL);

    buffer = read_line(buffer, result_of_the_cmd, 3, 0, 5);
    gtk_tree_store_set(treestore, &toplevel, USER, buffer , -1);

    buffer = read_line(buffer, result_of_the_cmd, 3, 13, 14);
    gtk_tree_store_set(treestore, &toplevel, PID, atoi(buffer) , -1);

    buffer = read_line(buffer, result_of_the_cmd, 3, 15, 19);
    gtk_tree_store_set(treestore, &toplevel, CPU, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 3, 21, 24);
    gtk_tree_store_set(treestore, &toplevel, MEM, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 3, 24, 31);
    gtk_tree_store_set(treestore, &toplevel, VSZ, atoi(buffer), -1);

    buffer = read_line(buffer, result_of_the_cmd, 3, 33, 37);
    gtk_tree_store_set(treestore, &toplevel, RSS, atoi(buffer), -1);

    buffer = read_line(buffer, result_of_the_cmd, 3, 38, 39);
    gtk_tree_store_set(treestore, &toplevel, TTY, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 3, 47, 49);
    gtk_tree_store_set(treestore, &toplevel, STAT, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 3, 52, 57);
    gtk_tree_store_set(treestore, &toplevel, START, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 3, 60, 64);
    gtk_tree_store_set(treestore, &toplevel, TIME, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 3, 65, 82);
    gtk_tree_store_set(treestore, &toplevel, COMMAND, buffer, -1);

    /* 3ème ligne */

    /* Append a second top level row, and fill it with some data */
    gtk_tree_store_append(treestore, &toplevel, NULL);

    buffer = read_line(buffer, result_of_the_cmd, 4, 0, 5);
    gtk_tree_store_set(treestore, &toplevel, USER, buffer , -1);

    buffer = read_line(buffer, result_of_the_cmd, 4, 13, 14);
    gtk_tree_store_set(treestore, &toplevel, PID, atoi(buffer) , -1);

    buffer = read_line(buffer, result_of_the_cmd, 4, 15, 19);
    gtk_tree_store_set(treestore, &toplevel, CPU, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 4, 21, 24);
    gtk_tree_store_set(treestore, &toplevel, MEM, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 4, 24, 31);
    gtk_tree_store_set(treestore, &toplevel, VSZ, atoi(buffer), -1);

    buffer = read_line(buffer, result_of_the_cmd, 4, 33, 37);
    gtk_tree_store_set(treestore, &toplevel, RSS, atoi(buffer), -1);

    buffer = read_line(buffer, result_of_the_cmd, 4, 38, 39);
    gtk_tree_store_set(treestore, &toplevel, TTY, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 4, 47, 49);
    gtk_tree_store_set(treestore, &toplevel, STAT, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 4, 52, 57);
    gtk_tree_store_set(treestore, &toplevel, START, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 4, 60, 64);
    gtk_tree_store_set(treestore, &toplevel, TIME, buffer, -1);

    buffer = read_line(buffer, result_of_the_cmd, 4, 65, 82);
    gtk_tree_store_set(treestore, &toplevel, COMMAND, buffer, -1);

    return GTK_TREE_MODEL(treestore);
}

le fichier nommé read_write.c :

#include <stdlib.h>
#include <string.h>
#include <gtk-2.0/gtk/gtk.h>
#include <gtkextra/gtkextra.h>
#include <gtkextra/gtksheet.h>

#include "../includes/constantes.h"
#include "../includes/read_write.h"

char *execute_command(FILE *result_of_the_cmd)
{
    FILE *pipe = NULL;
    const char *cmd = "ps -axu";
    char *buffer = NULL;

    size_t ret = 0;

    result_of_the_cmd = fopen("/home/thibault/Bureau/cmd_results.txt", "w+");
    if(result_of_the_cmd == NULL)
    {
        perror("fopen() ");
        exit(-1);
    }

    buffer = malloc(40000 * sizeof(char*));
    if(buffer == NULL)
    {
        perror("malloc() ");
        exit(-1);
    }

    pipe = popen(cmd, "r");
    if(pipe == NULL)
    {
        perror("popen() ");
        exit(-1);
    }

    ret = fread(buffer, sizeof(char), 40000, pipe);
    if(ret <= 0)
        perror("fread() ");

    buffer[strlen(buffer) - 1] = 0;

    if(fputs(buffer, result_of_the_cmd) == EOF)
    {
        perror("fputs() ");
        exit(-1);
    }

    printf("%ld\n", strlen(buffer));

    fclose(result_of_the_cmd);

    return buffer;
}


char *read_line(char * buffer, FILE *result_of_the_cmd, size_t line_number, size_t start, size_t end_of_read)
{
    gchar *buffer_line = NULL;
    gchar *temp = NULL;
    size_t i = 0;
    size_t j = 0;

    result_of_the_cmd = fopen("/home/thibault/Bureau/cmd_results.txt", "r");
    if(result_of_the_cmd == NULL)
    {
        perror("fopen() ");
        exit(-1);
    }

    buffer_line = malloc(100 * sizeof(char));
    if(buffer_line == NULL)
    {
        perror("malloc() ");
        exit(-1);
    }

    temp = malloc( (end_of_read - start) * sizeof(char));
    if(temp == NULL)
    {
        perror("malloc() ");
        exit(-1);
    }

    for(i = 0; i < line_number; i++)
    {
        if(fgets(buffer_line, 100, result_of_the_cmd) == NULL)
        {
            perror("fgets() ");
            exit(-1);
        }
    }

    for(i = start; i < end_of_read; i++)
    {
        temp[j] = buffer_line[i];
        j++;
    }

    printf("%s", temp);

    free(buffer_line);

    fclose(result_of_the_cmd);

    return temp;
}

les headers :

constantes.h contenant les prototypes du main.c :

#ifndef CONSTANTES_H_INCLUDED
#define CONSTANTES_H_INCLUDED

GtkWidget *create_view_and_model(char *buffer, char * buffer_line, FILE *result_of_the_cmd);
void age_cell_data_func(GtkTreeViewColumn *col, GtkCellRenderer *renderer,GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data);
GtkTreeModel *create_and_fill_model(FILE *result_of_the_cmd);

enum
{
    USER,
    PID,
    CPU,
    MEM,
    VSZ,
    RSS,
    TTY,
    STAT,
    START,
    TIME,
    COMMAND
};

#endif

le header de read and write, nommé read_write.h :

#ifndef READ_WRITE_H_INCLUDED
#define READ_WRITE_H_INCLUDED

char *execute_command(FILE *result_of_the_cmd);
char *read_line(char * buffer, FILE *result_of_the_cmd, size_t line_number, size_t start, size_t end_of_read);

#endif

Voila encore déolé de vous "vomir" l'ensembe du code, mais pour comprendre et trouver l'erreur c'est le mieux je pense car expliquer le problème aurait etait pour moi bien difficile.

Merci d'avance au courageux qui prendront le temps de se plonger dans ce fatras et de m'apporter quelques aides.

Tchaoo !!!

Dernière modification par CodeRom (Le 26/05/2018, à 05:56)

Hors ligne

#2 Le 22/05/2018, à 11:18

CodeRom

Re : [Résolu] Pango-WARNING :Invalid UTF-8 string passed to pango

Bon je crois que j'ai crée le sujet trop tôt car je suis en train de modifier complètement le code notamment l'affichage (j'incorpore des boucles car sinon ça va être l'enfer ligne par ligne).Et je pense que le problème va se corriger de lui même durant se remanimant (poua je deteste ce mot).

Stand by donc smile

Dernière modification par CodeRom (Le 22/05/2018, à 11:19)

Hors ligne

#3 Le 22/05/2018, à 16:30

CodeRom

Re : [Résolu] Pango-WARNING :Invalid UTF-8 string passed to pango

Re salut bon le problème est toujours present, mais j'ai trouvé a peu pret l'endroit d'où celà vient, ce sont de ces lignes que l'erreur survient :

GtkTreeModel *create_and_fill_model(FILE *result_of_the_cmd)
{
    GtkTreeStore  *treestore;
    GtkTreeIter    toplevel;

    char *buffer = NULL;
    size_t i = 0;
    size_t j = 0;

    treestore = gtk_tree_store_new(11, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT,
                                   G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING)

    for(i = 1, j = 2; i < 10; i++, j++)
    {
        gtk_tree_store_append(treestore, &toplevel, NULL);

        /*Column USER */
        buffer = read_line(buffer, result_of_the_cmd, j, 0, 4);
        gtk_tree_store_set(treestore, &toplevel, USER, buffer, -1);

        /* Column PID */
        buffer = read_line(buffer, result_of_the_cmd, j, 13, 14);
        gtk_tree_store_set(treestore, &toplevel, PID, atoi(buffer), -1);

        /* Column %CPU */
        buffer = read_line(buffer, result_of_the_cmd, j, 16, 19);
        gtk_tree_store_set(treestore, &toplevel, CPU, buffer, -1);

        /* Column %MEM */
        buffer = read_line(buffer, result_of_the_cmd, j, 21, 24);
        gtk_tree_store_set(treestore, &toplevel, MEM, buffer, -1);

        /* Column VSZ */
        buffer = read_line(buffer, result_of_the_cmd, j, 25, 31);
        gtk_tree_store_set(treestore, &toplevel, VSZ, buffer, -1);

       /* Column RSS */
        buffer = read_line(buffer, result_of_the_cmd, j, 33, 37);
        gtk_tree_store_set(treestore, &toplevel, RSS, atoi(buffer), -1);

       /* Column TTY */
        buffer = read_line(buffer, result_of_the_cmd, j, 38, 39);
        gtk_tree_store_set(treestore, &toplevel, TTY, buffer, -1);

       /* Column STAT */
        buffer = read_line(buffer, result_of_the_cmd, j, 47, 49);
        gtk_tree_store_set(treestore, &toplevel, STAT, buffer, -1);

       /* Column START */
        buffer = read_line(buffer, result_of_the_cmd, j, 52, 57);
        gtk_tree_store_set(treestore, &toplevel, START, buffer, -1);

       /* Column TIME */
        buffer = read_line(buffer, result_of_the_cmd, j, 60, 64);
        gtk_tree_store_set(treestore, &toplevel, TIME, buffer, -1);

        /* Column COMMAND */
        buffer = read_line(buffer, result_of_the_cmd, j, 65, 85);
        gtk_tree_store_set(treestore, &toplevel, COMMAND, buffer, -1);
    }

    return GTK_TREE_MODEL(treestore);
}

Ces lignes affichent en fait dans le tree view les neuf 1er lignes de la commande ps -axu, et de là survient l'erreur maudite : Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()

Voila tout mon problème, et c'est toujours pareil je compile ça s'affiche sans problème , je re compile affichage dégueulasse plus erreur et ainsi de suite la roulette russe continue.
J'avoues être un peu perdus.

Dernière modification par CodeRom (Le 22/05/2018, à 16:30)

Hors ligne

#4 Le 26/05/2018, à 05:55

CodeRom

Re : [Résolu] Pango-WARNING :Invalid UTF-8 string passed to pango

C'est bon j'ai trouvé, j'avais bien compris que le problème venais des chaines passé au tree view et qu'il fallait qu'elles soient en utf-8 il a donc fallu simplement que je les convertissent via la fonction g_convert() et l'erreur a disparus.

Problème solved !

Dernière modification par CodeRom (Le 26/05/2018, à 05:57)

Hors ligne