Changes between Version 1 and Version 3 of Ticket #70670


Ignore:
Timestamp:
Sep 1, 2024, 9:45:44 AM (3 weeks ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

I get the same conversions as you (insertion of ' and ^ after accented characters in an attempt to mimic in ASCII what those accents look like) regardless whether I use /usr/bin/iconv on macOS 12 (Apple's GNU libiconv 1.11) or /opt/local/bin/iconv (MacPorts GNU libiconv 1.17) therefore it is not a MacPorts bug.

I believe iconv uses locale information provided by the operating system to guide its conversions. Therefore your bug, I suppose, is with macOS, although I assume the result we observe is intentional and not considered a bug. In particular, what we're observing is called transliteration:

https://www.gnu.org/software/libiconv/

It has also some limited support for transliteration, i.e. when a character cannot be represented in the target character set, it can be approximated through one or several similarly looking characters. Transliteration is activated when //TRANSLIT is appended to the target encoding name.

You have specifically requested that transliteration be enabled.

I don't know why you get different results on Linux. That is, it is presumably because the locale information provided by Linux differs from that provided by macOS, but I don't know why these two OS vendors have decided to do that. Possibly, the locale information on your Linux does not support transliteration therefore your request to enable transliteration is being ignored on Linux.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #70670

    • Property Status changed from new to closed
    • Property Summary changed from iconv on macOS Ventura 13.6+ does not perform correct conversions to libiconv @1.17_0: iconv on macOS Ventura 13.6+ does not perform correct conversions
    • Property Keywords iconv libiconv removed
    • Property Owner set to ryandesign
    • Property Resolution changed from to invalid
    • Property Port @1.17_0 (active) removed
  • Ticket #70670 – Description

    v1 v3  
    22
    33I have C&P a line from a PDF file (a French programming guide), to Terminal.app:
    4 'print("Numéro de boucle", i)'
     4
     5{{{
     6print("Numéro de boucle", i)'
     7}}}
    58
    69I wanted to convert this line to ASCII before pasting into my editor. So I used 'iconv' as shown below. In each case, I used 'file' to check the "from" encoding :
     
    1215% echo 'print("Numéro de boucle", i)' | iconv -f utf-8 -t ascii//translit
    1316print("Num'ero de boucle", i)
     17}}}
    1418
    1519?!?!?!?   I tried another example:
    1620
     21{{{
    1722% echo "print("Protégé. Señorita. Coup de grâce", i)" | file -
    1823/dev/stdin: Unicode text, UTF-8 text