7

I am using Lynx on OS X 10.11. However, it does not print UTF-8 for non-ASCII characters, but rather either an ASCII representation of them, or the ef bf bd "replacement" character (?).

I have been studying this guide for help.

The output from the locale command:

locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

When I run Lynx with

lynx http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt

here is what the display appears like:

Lynx displays UTF-8 test page incorrectly

According to the posts in the article, Lynx should print UTF-8 properly.

lynx -dump ... prints the same.

(running export LC_ALL="en_US.UTF-8" doesn't help either.)

What is strange, is that if I run with the -mime_header argument, eg:

lynx -mime_header http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt

It prints the characters properly. (Albeit, as a dump rather than opening in a browser environment):

Lynx displays UTF-8 test page correctly

EDIT:

Forgot to mention,

-assume_charset=utf8 and -assume_unrec_charset=utf8

don't help either.

EDIT:

Well I am able to get the output I want by hard-setting CHARACTER_SET in lynx.cfg. Though this seems like a bit of a workaround, as in the documentation it states:

# ...  The 'o'ptions menu setting will be stored in the user's RC
# file whenever those settings are saved, and thereafter will be used as the
# default.  ...

However, the setting only persists for the session it is set in. That won't work for me as I am primarily using lynx -dump in a script. But as I pretty much am only UTF-8, I guess I can live with the hard setting for now.

1
  • This isn't a programming question. I suggest deleting it and reposting in Unix & Linux. (FWIW, it works for me on Ubuntu.) Jul 27, 2018 at 2:08

1 Answer 1

8

I do think you should use

lynx -dump --display_charset=utf-8

rather than hard-setting the config file

so

lynx --display_charset=utf-8 http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt

alternatively

check https://www.brow.sh/

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.