diff --git a/swh/model/cli.py b/swh/model/cli.py
index 7b52ce919618ad857714f56f2793a64bfdce8c59..036844dfc754601f9b3e60b1f68942815af1a33f 100644
--- a/swh/model/cli.py
+++ b/swh/model/cli.py
@@ -4,7 +4,6 @@
 # See top-level LICENSE file for more information
 
 import click
-import locale
 import os
 import sys
 
@@ -107,8 +106,7 @@ def identify(obj_type, verify, show_filename, objects):
         for (obj, pid) in results:
             msg = pid
             if show_filename:
-                encoding = locale.getpreferredencoding(do_setlocale=False)
-                msg = '%s\t%s' % (pid, obj.decode(encoding))
+                msg = '%s\t%s' % (pid, os.fsdecode(obj))
             click.echo(msg)