View previous topic :: View next topic |
Author |
Message |
molot Apprentice
Joined: 26 Feb 2005 Posts: 214 Location: Warsaw, Poland
|
Posted: Wed Sep 14, 2011 10:25 am Post subject: Znaki niedrukowane w nazwach plików |
|
|
Hej
Pilnie potrzebuję wywalić niedrukowalne znaki z nazw plików, a przy tym zachować polskie litery. Nazwy plików są w utf-8.
Macie jakiś prosty sposób na to? Ja szukam od wczoraj rana, i właśnie się poddałem. Klasa [:print:] zdaje się nie obejmować naszych znaków, niestety, [a-z] też je pomija. _________________ "I just have to run faster than the slowest party member" |
|
Back to top |
|
|
SlashBeast Retired Dev
Joined: 23 May 2006 Posts: 2922
|
Posted: Wed Sep 14, 2011 11:51 am Post subject: |
|
|
w baszu [a-z] zachowuje polskie znaki.
Code: | slashbeast@frontier ~ % bash
slashbeast@frontier ~ $ variable='łĄŁŚÐĄŁŚÐśąð²³¶¶đśðłąśðąśźżć'
slashbeast@frontier ~ $ echo $variable
łĄŁŚÐĄŁŚÐśąð²³¶¶đśðłąśðąśźżć
slashbeast@frontier ~ $ echo ${variable//[^a-zA-Z]}
łĄŁŚÐĄŁŚÐśąðđśðłąśðąść | Mogl bys to zalatwic jakims skryptem, parsujac output finda z separatorem na null character ustawionym.
Pozatym, uzywanie polskich znakow i spacji w nazwach plikow to proszenie sie o problemy. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|