Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 text on FreeBSD #76

Closed
elfham opened this issue Feb 7, 2022 · 1 comment
Closed

UTF-8 text on FreeBSD #76

elfham opened this issue Feb 7, 2022 · 1 comment

Comments

@elfham
Copy link

elfham commented Feb 7, 2022

When opening UTF-8 text in FreeBSD, a warning will appear.

% cat utf8.txt
あいうえお
% less utf8.txt

==> append :: to filename to view the utf-8 encoded file
あいうえお
utf8.txt (END)

https://github.com/wofr06/lesspipe/blob/lesspipe/lesspipe.sh#L718

lclocale=$(echo ${locale##*.}|sed 's/\(.*\)/\L\1/')

Here $lclocale is set to "LUTF-8" instead of "utf-8".

Since \L is not a standard, but an extension of GNU sed, it is better to use tr or something similar instead.

@wofr06
Copy link
Owner

wofr06 commented Feb 8, 2022

Thanks, just changed conversion from sed to tr

@wofr06 wofr06 closed this as completed Feb 8, 2022
vishwin pushed a commit to vishwin/freebsd-ports that referenced this issue Aug 21, 2022
 - use tr to convert into lower case, test string adjustments included
   in 2.03 version ( wofr06/lesspipe#76 )
 - remove perl storable (pst) files interpretation (security fix)

ChangeLog:	https://github.com/wofr06/lesspipe/blob/lesspipe/ChangeLog
PR:		265610
Reported by:	elfham <elfham+freebsd@gmail.com>
Approved by:	maintainer timeout, >2 weeks
MFH:		2022Q3
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Aug 21, 2022
 - use tr to convert into lower case, test string adjustments included
   in 2.03 version ( wofr06/lesspipe#76 )
 - remove perl storable (pst) files interpretation (security fix)

ChangeLog:	https://github.com/wofr06/lesspipe/blob/lesspipe/ChangeLog
PR:		265610
Reported by:	elfham <elfham+freebsd@gmail.com>
Approved by:	maintainer timeout, >2 weeks
MFH:		2022Q3

(cherry picked from commit d819201)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants