Hello all,
## Context 
I recently forked the project and started to work in examples/dwg2svg.C to cover some my needs. I want to export architectural plans and keep the layers organization (either groups in svg or a layer-name attribute in each tags). 
I reached to add lwpolyline and ellipse export but I'm facing issues to get the layer name.

## Issue

```c
static void
output_LWPOLYLINE (dwg_object *obj)
{
  int error, index, num_points;
  Dwg_Entity_LWPOLYLINE *poly;
  dwg_point_2d *points;
  
  index = dwg_object_get_index (obj, &error);
  log_if_error ("object_get_index");
  poly = obj->tio.entity->tio.LWPOLYLINE;
  
  Dwg_Object_LAYER *layer = dwg_get_entity_layer(poly->parent);
  fprintf (stderr, "%s\n", layer->name);
}
```
This print only the first letter of the name when the next two options go in segmentation fault:
```c
  //char *utf8 = bit_convert_TU (dwg_ent_get_layer_name(poly, &error));
  //char *name =dwg_ent_get_layer_name(obj, &error);
```

As I didn't use C for many years, I think that I'm doing something wrong but don't no what. :'(

Does someone see what's wrong??

How should I access to object's layer name?
This is a GitHub Issue
repo:libredwg
owner:LibreDWG
Title : How should I access to object's layer name?
Issue date:

--- start body ---
Hello all,
## Context 
I recently forked the project and started to work in examples/dwg2svg.C to cover some my needs. I want to export architectural plans and keep the layers organization (either groups in svg or a layer-name attribute in each tags). 
I reached to add lwpolyline and ellipse export but I'm facing issues to get the layer name.

## Issue

```c
static void
output_LWPOLYLINE (dwg_object *obj)
{
  int error, index, num_points;
  Dwg_Entity_LWPOLYLINE *poly;
  dwg_point_2d *points;
  
  index = dwg_object_get_index (obj, &error);
  log_if_error ("object_get_index");
  poly = obj->tio.entity->tio.LWPOLYLINE;
  
  Dwg_Object_LAYER *layer = dwg_get_entity_layer(poly->parent);
  fprintf (stderr, "%s\n", layer->name);
}
```
This print only the first letter of the name when the next two options go in segmentation fault:
```c
  //char *utf8 = bit_convert_TU (dwg_ent_get_layer_name(poly, &error));
  //char *name =dwg_ent_get_layer_name(obj, &error);
```

As I didn't use C for many years, I think that I'm doing something wrong but don't no what. :'(

Does someone see what's wrong??

--- end body ---
