1

I use expand to expand tabs to spaces. For utf8 files expand doesn't work correctly. E.g. in ć\ta tab is expanded to 6 spaces while in a\ta to 7 spaces.

How do I make it work for utf8 files?

Z0OM
  • 1
  • 4
  • 24
  • 56
Marcin Król
  • 243
  • 2
  • 9

1 Answers1

1

You could use a short bit of Python3 code, and just pipe the text thrugh it:

#!/usr/bin/python3
import sys, os
for line in sys.stdin.readlines():
    sys.stdout.write(line.expandtabs())
meuh
  • 49,672
  • 2
  • 52
  • 114