# Guile's nftw and utf-8 encoding

**URL:** <https://forum.systemcrafters.net/t/guiles-nftw-and-utf-8-encoding/1667>\
**Category:** Programming\
**Tags:** guile\
**Created:** [June 13, 2025, 10:55pm UTC](https://forum.systemcrafters.net/t/guiles-nftw-and-utf-8-encoding/1667 "2025-06-13T22:55:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirkoh](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mirkoh](https://forum.systemcrafters.net/u/mirkoh)\
**Post date:** [June 13, 2025, 10:55pm UTC](https://forum.systemcrafters.net/t/guiles-nftw-and-utf-8-encoding/1667/1 "2025-06-13T22:55:12Z")

</div>

I’m trying to process some files using nftw but the read values do not seem to be encoded in utf-8. Is there a way to force this?, or is there a different function that should be used instead of ntfw?

I tried this, which works for command line arguments, but not for ntfw.

```auto
(set-port-encoding! (current-input-port) "UTF-8")
(set-port-encoding! (current-output-port) "UTF-8")

```

---

<div class="post-metadata">

**Author:** ![mirkoh](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mirkoh](https://forum.systemcrafters.net/u/mirkoh)\
**Post date:** [June 15, 2025, 1:41pm UTC](https://forum.systemcrafters.net/t/guiles-nftw-and-utf-8-encoding/1667/2 "2025-06-15T13:41:32Z")

</div>

It was a “failed to installed locale” problem. The commands ftw and nftw worked well in the repl but then when executing the program in a terminal it had problems with the encoding. I’m using autotools for the installation (of guile and a small guile program) and at some point it went out of sync with the guix-profile/lib/locale/2.39 version, It was searching for the 2.35 version.

Thanks to @ashraz, the use of the strace command on guile --version allowed me to debug this issue.

Maybe this is a pitfall of using autotools for guile programs in a guix environment?. I have two versions of guile, one installed in /usr/local/lib/guile, the other one in the guix store.

---

<div class="post-metadata">

**Author:** ![ashraz](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/ashraz/32/509_2.png) [@ashraz](https://forum.systemcrafters.net/u/ashraz)\
**Post date:** [June 15, 2025, 5:15pm UTC](https://forum.systemcrafters.net/t/guiles-nftw-and-utf-8-encoding/1667/3 "2025-06-15T17:15:12Z")

</div>

> [@mirkoh](#):
>
> Thanks to @ashraz, the use of the strace command on guile --version allowed me to debug this issue.

For a second, I was a bit confused because I couldn’t remember helping you on that issue, but I guess you used the solution/`strace` command from the following thread:

- [GNU Guile warning: failed to install locale - #2 by ashraz](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205/2) (strace)
- [GNU Guile warning: failed to install locale - #5 by ashraz](https://forum.systemcrafters.net/t/gnu-guile-warning-failed-to-install-locale/205/5) (environment variable).

---

<div class="post-metadata">

**Author:** ![mirkoh](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mirkoh](https://forum.systemcrafters.net/u/mirkoh)\
**Post date:** [June 15, 2025, 9:22pm UTC](https://forum.systemcrafters.net/t/guiles-nftw-and-utf-8-encoding/1667/4 "2025-06-15T21:22:22Z")

</div>

Yes, thank you, I should have clarified that. I was not aware of the link to post feature, your reply is pointing to the precise post with the solution, using the following command:

```auto
strace guile --version |& grep -E "warning:.*install locale" -B6

```

After reinstalling guile (using guix) this command displays nothing, it used to show a failed to load the 2.35 locale message.
