Bug 203706 - sysutils/uniutils: fix hard-coded endian assumption
Summary: sysutils/uniutils: fix hard-coded endian assumption
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Thierry Thomas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-11 19:10 UTC by John Hein
Modified: 2015-10-24 16:49 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (thierry)


Attachments
[patch] don't hard code endianness (1.58 KB, patch)
2015-10-11 19:10 UTC, John Hein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2015-10-11 19:10:10 UTC
Created attachment 161923 [details]
[patch] don't hard code endianness

Attached is a patch to detect endianness and use iconv with the right "from" encoding.

Otherwise, you get something like the following if you're using the encoding with the wrong endianness:

% utf8lookup d6
No LINES variable in environment so unable to determine lines per page.
Using default of 24.
iconv: (stdin):1:0: cannot convert

That's because there's no valid unicode codepoint for 0xd6000000 (the wrong endian represenation of the U+00D6 codepoint).


Also while here, change /usr/local replacement from LOCALBASE -> PREFIX (although the replacement is not used in the current version of the port).


The utf8lookup patch was sent upstream recently - no response yet.
Comment 1 Thierry Thomas freebsd_committer freebsd_triage 2015-10-24 16:48:55 UTC
Committed, thanks!

Also thanks for submitting your patch to upstream: please let me know about any answer.
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-10-24 16:49:10 UTC
A commit references this bug:

Author: thierry
Date: Sat Oct 24 16:48:49 UTC 2015
New revision: 400131
URL: https://svnweb.freebsd.org/changeset/ports/400131

Log:
  - Fix hard-coded endian assumption;

  - Change /usr/local replacement from LOCALBASE -> PREFIX.

  PR:		ports/203706
  Submitted by:	John Hein <z7dr6ut7gs (at) snkmail.com>

Changes:
  head/sysutils/uniutils/Makefile
  head/sysutils/uniutils/files/patch-utf8lookup