---
name: "Debbugs::UTF8"
section: "3pm"
platform: "linux"
package: "libdebbugs-perl"
version: "2.6.4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Debbugs::UTF8"
---

# Debbugs::UTF8(3pm)

## NAME

Debbugs::UTF8 -- Routines for handling conversion of charsets to UTF8

## SYNOPSIS

use Debbugs::UTF8;

## DESCRIPTION

This module contains routines which convert from various different charsets to UTF8.

## FUNCTIONS

## UTF-8

These functions are exported with the :utf8 tag

### encode\_utf8\_structure

```
     %newdata = encode_utf8_structure(%newdata);
```

Takes a complex data structure and encodes any strings with is\_utf8 set into their constituent octets.

### encode\_utf8\_safely

```
     $octets = encode_utf8_safely($string);
```

Given a `$string`, returns the octet equivalent of `$string` if `$string` is in perl's internal encoding; otherwise returns `$string`.

Silently returns REFs without encoding them. \[If you want to deeply encode REFs, see encode\_utf8\_structure.\]

### decode\_utf8\_safely

```
     $string = decode_utf8_safely($octets);
```

Given `$octets` in UTF8, returns the perl-internal equivalent of `$octets` if `$octets` does not have is\_utf8 set; otherwise returns `$octets`.

Silently returns REFs without encoding them.

### convert\_to\_utf8

```
    $utf8 = convert_to_utf8("text","charset");
```
