News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Copy & Paste & character in file attachments titles problem

Started by keyboard, May 28, 2022, 08:43:52 AM

Previous topic - Next topic

keyboard

Hi

Need advice again

When I copy & Paste a file name with "&" , I get some funny symbol !

I will rename a file and call it
Al Bano & Romina Power - Impossibile.mid


I will then attach the file and I get
Al Bano & Romina Power - Impossibile.mid

Please advise

Ron

Doug Heffernan

What is collation character set to for the database? If it is not already set to utf-8, you can convert it either through the forum 's Admin Panel->Maintenance->Database->Convert HTML-entities to UTF-8 characters, or through phpmyadmin. Have a look at my post below on how to do that.

https://www.simplemachines.org/community/index.php?topic=582171.msg4125320#msg4125320

Whatever method you choose, do not forget to make first a backup of your database prior to the utf-8 conversion.

Additionally you can have a look at this link as well and double check that the utf-8 conversion has been done properly/thoroughly.

https://wiki.simplemachines.org/smf/UTF-8_Readme

Hope it helps.

Arantor

Um... & is not a character that's up in the UTF-8 extended range, it's character 39, way down in the base set so it won't be UTF-8 encoding that's the problem.

More likely it's SMF over-escaping - because & has special meaning in HTML and routinely gets encoded internally as the amp; form shown. Could well be an SMF bug, there are a few lurking with attachments.

keyboard

Quote from: Arantor on May 28, 2022, 10:12:51 AMUm... & is not a character that's up in the UTF-8 extended range, it's character 39, way down in the base set so it won't be UTF-8 encoding that's the problem.

More likely it's SMF over-escaping - because & has special meaning in HTML and routinely gets encoded internally as the amp; form shown. Could well be an SMF bug, there are a few lurking with attachments.

Boy ! That is beyond my skill set to understand.   Hopefully there will be a solution.

Doug Heffernan

I misread your first post @keyboard, sorry about that. I thought that it was about text in posts and not attachments.

Did it happen out of nowhere or was it always like this?

keyboard

I just tried to upload a file at createsongstyles and it did the same thing

it's only on 2.1 not 2.0.*

You cannot view this attachment.

Doug Heffernan

I tried this on a brand new 2.1.2. forum and I could reproduce this as well. I have moved this topic to the Bug Reports forum and edited the title to reflect the issue, so our developers can take a look at it.



Kindred

Are & even valid characters in files names?

They should not be, if they are... lol
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Quote from: Kindred on May 28, 2022, 12:20:27 PMAre & even valid characters in files names?

Yes, perfectly valid. Pretty much the kickers across the main operating systems are :, /, \, *, ?, ", | and NUL.

The non-printables are generally disliked too. There are a few specific restricted filenames on Windows that you can't have, e.g. you can't name something CON (because it's a reserved filename for the console), LPT1 (printer), COM1 (serial port) etc.

MacOS and Linux tend to be more open since they don't restrict the shell meta characters (because escape is normal there, unlike Windows where quoting is the usual practice without escaping)

The issue is SMF is over-encoding the filename.

Steve

Please do not PM me for support.

Advertisement: