Create .nfo file in ISO-8859-1 or UTF-8

Hey guys,

I have a little problem,

Let's say I create this script :

#!/bin/sh
nfo_file="/home/admin/info.nfo"
echo " Hello " > $nfo_file

It seems to be okay :

cat /home/admin/info.nfo
 Hello 
file -bi /home/admin/info.nfo
text/plain; charset=utf-8

But when I open it in a Windows computer, using notepad++ i.e., this is what it output :

������ Hello ������

What can I do for it to work?

I tried this :

iconv -f utf8 -t iso88591//translit sample.nfo -o sample2.nfo
Ouput on Windows : ??? Hello ???
iconv -f utf8 -t utf8//translit sample.nfo -o sample2.nfo
Ouput on Windows : ������ Hello ������

Thanks for the help.

Antoine L.

There doesn't seem to be an equivalent of those UTF-8 characters in the iso8859-1 character encoding that iconv knows of. Can you switch that windows computer to UTF-8? Can you replace the chars manually?

In fact, I don't need it to be iso88591, I just need it to be recognized by notepad++, it can stay in utf-8.

What do you mean by that? Replace the chars in the file? Probably, but still not showing correctly in notepad++.

Thanks!!

Envoy� de mon iPhone en utilisant Tapatalk

Try:

iconv -f utf8 -t CP437 sample.nfo -o sample2.nfo

I'll try that tomorrow and come back to you

Envoy� de mon iPhone en utilisant Tapatalk

It probably won't look right in the UNIX charset.

As the extension you used was .nfo I'm guessing you wanted a file that uses DOS (codepage 437) characters. Quite commonly used in ANSI art.

Notepad++ is quite capable of viewing UTF-8, simply select Encoding->UTF-8.

The version of Notepad++ I have (v5.9.6.2) doesn't have CP437 encoding however most of the DOS graphics characters will display OK with Encoding->Character sets->Greek->OEM 737 or Hebrew->OEM 862

Thanks, it worked with -t437//translit, yeah i need 437 characters, and it works well on notepad++ with the proper iconv command.

Thank you again guys :slight_smile:

Envoy� de mon iPhone en utilisant Tapatalk