MinimServer Forum

Full Version: A question for the geek Simon about NFC / NFD
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Simon

first, this post could be elsewhere, feel free to move.

Here is the problem : I transfer all my music from my Macbook to a NAS (Qnap or Syno) using Transmit .

And of course, all accented letters are coded using Apple's horrible 2 characters NFD coding. As a result, files or folders with accented letters don't sync with Amazon cloud.

I was searching for a way to convert automatically from NFD to NFC on the NAS.

It seems iconv("UTF-8-MAC", "UTF-8", $file) should do the job, however, even if phpinfo says the contrary, it seems iconv is not available, neither on qnap nor on synology.

Simon, I know you did it in java, but how did you adress this issue ?

Thx
Best
Sorry for jumping in here, which NAS are you using?

I can't help you with Synology, but if you are using a QNAP you can easily add PHP iconv support by installing the Optware package and then doing:

Code:
ipkg update
ipkg install php-iconv
Thx BlueDog

yes a Qnap, to which I am new.

ipkg not installed, and I don't find optware under appStore. I read it is now deprecated...
(07-04-2017 20:00)lyapounov Wrote: [ -> ]Simon, I know you did it in java, but how did you adress this issue ?

I used the java.text.Normalizer class to convert to NFC if the data is not already in NFC format.
(07-04-2017 22:04)simoncn Wrote: [ -> ]
(07-04-2017 20:00)lyapounov Wrote: [ -> ]Simon, I know you did it in java, but how did you adress this issue ?

I used the java.text.Normalizer class to convert to NFC if the data is not already in NFC format.

Thanks Simon

unfortunatly those php classes are not installed on a qnap

Best
(07-04-2017 21:37)lyapounov Wrote: [ -> ]Thx BlueDog

yes a Qnap, to which I am new.

ipkg not installed, and I don't find optware under appStore. I read it is now deprecated...

Wow! I did not know that, I just hope my QNAP never fails as I rely on Optware for a lot of things. Sad

The way I see it you have two options:

Have a dig around the 'net and QNAP forums and see if there is still a package available that you can install manually, or install another app package that will install iconv as a dependency.

Actually, there is a third option but a bit of messing around. Now you have the files on your QNAP you could copy them across to a PC, fix the encoding there, then copy them back to the NAS again.
So, I did a bit of digging around and there is an alternative for Optware called Entware:

https://github.com/Entware-ng/Entware-ng...n-QNAP-NAS

From what I can gather it's a replacement but not an official Qnap package, so you'll have to follow the manual install instructions as it won't show up in the Qnap package manager.
(08-04-2017 08:24)BlueDog Wrote: [ -> ]
(07-04-2017 21:37)lyapounov Wrote: [ -> ]Thx BlueDog

yes a Qnap, to which I am new.

ipkg not installed, and I don't find optware under appStore. I read it is now deprecated...

Wow! I did not know that, I just hope my QNAP never fails as I rely on Optware for a lot of things. Sad

The way I see it you have two options:

Have a dig around the 'net and QNAP forums and see if there is still a package available that you can install manually, or install another app package that will install iconv as a dependency.

Actually, there is a third option but a bit of messing around. Now you have the files on your QNAP you could copy them across to a PC, fix the encoding there, then copy them back to the NAS again.

Thx, but not possible.
Actually : all my filenames are ithout any accent, no blank, etc.. I have a php procedure which does exwtract from the track name and clean it.

The issue is with my folder names : some have accents.

But copying them on a PC means a) I have a PC and b) copying 2.5 T of data...

This is why I am searching for a way to do it on the Qnap itself.

Will investigate your package. Thx for this.
Reference URL's