Replace Polish characteres with standard ascii equivalent

蓝咒 提交于 2021-01-29 17:47:11

问题


Basically, I have a huge amount of files and many of them contain polish letters like 'ł, ż, ź, ó, ń' etc. in their filename.

What I want to reach is somehow change this polish letter to standard ascii character. (So for example ż => z, ń => n).

The files are located on the server with Linux Debian Squeezee.

What should I use and how to achieve the final effect?


回答1:


You put a PHP tag to your question, so my answer will consider that.

There is a question similiar to yours.

Convert national chars into their latin equivalents in PHP


Basically

Use Normalizer PHP extension.

http://www.php.net/manual/en/class.normalizer.php

<?php
    $string = 'ł ż ź ó ń';
    echo Normalizer::normalize($string);
?>


来源:https://stackoverflow.com/questions/35942715/replace-polish-characteres-with-standard-ascii-equivalent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!