If you need to convert polish letters with diacritical marks to UTF-8 codes, e.g. because of the file format standard requirements, you can use the below BASH script:

You can of course manipulate the $SWAP map to define your own set of characters you want to convert.

Did you like this? Share it:

5 thoughts on “Polish Letters to UTF-8 Converter

  1. Hi,
    Do you mind If I will put your modified script in my private code repository?
    I want to do some cleanup of by bunch of useful scripts and put it into versioned repo.
    I would like to also put your modified script to this repo.
    I renamed it to sed_pl2ascii.sh
    I modified the SWAPS array:
    SWAPS=(
    ['ą']=’a’
    ['Ą']=’A’
    ['ć']=’c’
    ['Ć']=’C’
    ['ę']=’e’
    ['Ę']=’E’
    ['ł']=’l’
    ['Ł']=’L’
    ['ń']=’n’
    ['Ń']=’N’
    ['ó']=’o’
    ['Ó']=’O’
    ['ś']=’s’
    ['Ś']=’S’
    ['ż']=’z’
    ['Ż']=’Z’
    ['ź']=’z’
    ['Ź']=’Z’
    )

    I will leave your home page and your name in the content unchanged.

    Reply

Leave a reply

required


*

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>