ฉันพยายามที่จะแปลงขวาคำพูดขีดเดียวกับผู้Apostrophetrใช้
tr "`echo -e '\xE2\x80\x99'`" "`echo -e '\x27'`" < a > b
กำหนดไฟล์ที่เข้ารหัส UTF-8 ชื่อaซึ่งมีตัวอย่างนี้:
We’re not a different species
“All alone?” Jeth mentioned.
OS X ใช้ BSD trและสร้างผลลัพธ์ที่ดี:
We're not a different species
“All alone?” Jeth mentioned.
Ubuntu ใช้ GNU trและสร้างผลลัพธ์ที่น่ารังเกียจนี้:
We'''re not a different species
''<9C>All alone?''<9D> Jeth mentioned.
ฉันจะบรรลุการแปลงนี้ใน Ubuntu ได้อย่างไร
echo It’s easy | perl -CS -Mutf8 -pe "tr/’/'/"