[Bug 205978] comms/smstools3: sendsms script not compatible with FreeBSD iconv
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Jan 6 19:23:46 UTC 2016
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205978
Bug ID: 205978
Summary: comms/smstools3: sendsms script not compatible with
FreeBSD iconv
Product: Ports & Packages
Version: Latest
Hardware: amd64
OS: Any
Status: New
Severity: Affects Many People
Priority: ---
Component: Individual Port(s)
Assignee: madpilot at FreeBSD.org
Reporter: satorium77 at gmail.com
Assignee: madpilot at FreeBSD.org
Flags: maintainer-feedback?(madpilot at FreeBSD.org)
Hi!
Sending SMS using sendsms script and UTF8 text as argument script not working
as it should.
How to reproduce:
1. sendsms 7903xxxxxxx "тест"
2. on mobile phone you will see something but not you're expecting
The reason of it is in this part of sendsms script:
ALPHABET=""
if which iconv > /dev/null 2>&1; then
if ! $ECHO -n "$TEXT" | iconv -t ISO-8859-15 >/dev/null 2>&1; then
ALPHABET="Alphabet: UCS"
fi
fi
iconv in FreeBSD returns 0 exit code even if there were some invalid chars, so
"Alphabet: UCS" will never be set.
How to fix:
1. If there are some errors in conversion iconv in FreeBSD will return message
in stderr which can be parsed. So to fix this bug the code above should be
replaced with:
ALPHABET=""
if which iconv > /dev/null 2>&1; then
if $ECHO -n "$TEXT" | iconv -t ISO-8859-15 2>&1 | grep "invalid" > /dev/null;
then
ALPHABET="Alphabet: UCS"
fi
fi
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-ports-bugs
mailing list