0

I facing one issue on my website.

Problem: The underscore "_" some time will automatically change to Questions Marks "?".

Example as below:

Below are my original filename

enter image description here

After saving into the database, the file name will automatically change as below. You may notice some of the underscores changed to question mark.

enter image description here

This problem is created by my user. I tried to replicate the problem, but unfortunately, I failed to replicate it. I also tried to upload the same file, but the filename uploaded successfully as the original file name. This is so weird that sometimes the filename is correct and sometimes not. Can someone please enlighten me where can I start to debug with?

Additional Note:

  • I am using MariaDB database
  • MVC without Entity framework
LPLN
  • 475
  • 1
  • 6
  • 20
Ng Zheng
  • 59
  • 1
  • 12

1 Answers1

1

Seems like you have fallen onto the same case as mysql here.

The default encoding for inbound connections isn't set properly. DEFAULT CHARSET will return as utf8 however character_set_server will be something different.

I can't be sure about the exact problem without seeing some of your retrieval code, but some information on MariaDB collation is here

Athanasios Kataras
  • 25,191
  • 4
  • 32
  • 61