Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Problem with Greek ...
 
Notifications
Clear all

Problem with Greek Characters in names

16 Posts
2 Users
0 Reactions
18.3 K Views
(@8omas)
Posts: 27
Active Member
Topic starter
 
[#2127]

Whenever I upload a file name with greek characters, the file's name become strange characters
e.g
I want to upload www-ΕΛΛ.txt
and in the db the file is stored as www-ΕΛΛ.txt


 
Posted : 06 Dec 2014 1H14
babynus
(@babynus)
Posts: 14953
Main Contributor Admin
 

And how is it retrieved (downloaded) ?

NB : there are some mandatory trnasformations in file name because most OS (including linux) cannot store files with special characters.


 
Posted : 06 Dec 2014 1H24
(@8omas)
Posts: 27
Active Member
Topic starter
 

As www-ΕΛΛ.txt
No problem here. But we cannot understand which file it is


 
Posted : 06 Dec 2014 1H33
(@8omas)
Posts: 27
Active Member
Topic starter
 

All files are renamed as attachement_xx
The problem is in the gui. I think that it has something to do with the storage of the filename in the db


 
Posted : 06 Dec 2014 2H08
babynus
(@babynus)
Posts: 14953
Main Contributor Admin
 

Hi,

Works fine for me, with server on Windows and with server on Linux. So it is not OS dependent.

Most possibly it is a Database configuration not compleetly UTF-8 compliante.
Look for UTF-8 in the forum, you'll find hints about correct configuration


 
Posted : 06 Dec 2014 13H46
(@8omas)
Posts: 27
Active Member
Topic starter
 

All other works fine.
I can write and read greek characters everywhere in projeqtor
The characters in db are readable as greek characters
I have mb_string enabled for projeqtror
The database is utf8
Tables are utf8_general_ci
Columns are utf8_general_ci
I have $enforceUTF8=true;

The only problems are attachements


 
Posted : 06 Dec 2014 17H20
(@8omas)
Posts: 27
Active Member
Topic starter
 

Some more info
-I use Projeqtor 4.5.2
- I had not this problem before (I already have attachements with Greek characters)
- I use a Linux Debian server
- Mysql Variables (I think that I have ut8 database system)
character set client utf8
character set connection utf8
character set database utf8
character set filesystem binary
character set results utf8
character set server utf8
character set system utf8
collation connection utf8_general_ci
collation database utf8_general_ci
collation server utf8_general_ci
- The notes in the activity are Greek
- The note IN the attachement is not readable

Settings in my.cnf
collation_server=utf8_general_ci
character_set_server=utf8

I think that sth is wrong, but I don't think this is the database setup.


 
Posted : 07 Dec 2014 1H47
(@8omas)
Posts: 27
Active Member
Topic starter
 

One more info
I changed the unreadable characters directly in db (for testing purposes) and the result was ok
I could see the greek characters.


 
Posted : 09 Dec 2014 11H45
babynus
(@babynus)
Posts: 14953
Main Contributor Admin
 

But can you still donwload the file ?


 
Posted : 09 Dec 2014 13H21
(@8omas)
Posts: 27
Active Member
Topic starter
 

Yes I can download it.

But I found sth else:
if my mbstring settings are like this:
mbstring.language = Neutral
mbstring.internal_encoding = UTF-8
mbstring.http_input = auto
mbstring.http_output = UTF-8
mbstring.encoding_translation = On
mbstring.detect_order = UTF-8
mbstring.substitute_character = none
I see what I told you.

if my mbstring settings are like this:
mbstring.language = Neutral
mbstring.internal_encoding = UTF-8
mbstring.http_input = UTF-8
mbstring.http_output = UTF-8
mbstring.encoding_translation = On
mbstring.detect_order = none
mbstring.substitute_character = none

I see the correct characters only AND only if the first characters is not GREEK
so
with the second sets of settings
the file www-ΕΛΛ.txt appears as www-ΕΛΛ.txt (CORRECT)
the file ΕΛΛ.txt appears as .txt (WRONG)


 
Posted : 09 Dec 2014 16H02
(@8omas)
Posts: 27
Active Member
Topic starter
 

the last problem exists also in the demo
check activity id 324 (project SGB)


 
Posted : 09 Dec 2014 23H21
(@8omas)
Posts: 27
Active Member
Topic starter
 

Something that might help:
In
/web/tool/saveAttachement.php
in line 212
If I change
$attachement->fileName=basename($uploadedFile['name']);
to
$attachement->fileName=$uploadedFile['name'];

the file name is dispayed correctly and I can download it.


 
Posted : 14 Dec 2014 16H20
babynus
(@babynus)
Posts: 14953
Main Contributor Admin
 

Good hint.
I will have a look.


 
Posted : 14 Dec 2014 17H52
babynus
(@babynus)
Posts: 14953
Main Contributor Admin
 

You were right : basename() is not UTF8 secure unless setlocale() is called before.
Moreover, it was not usefull in that case, so removing it is best fix.
ALso done one addDocumentVerison.php (same issue).
Fix will be deployed on V4.5.3


 
Posted : 14 Dec 2014 23H34
(@8omas)
Posts: 27
Active Member
Topic starter
 

Do you mean saveDocumentVersion.php?


 
Posted : 15 Dec 2014 0H14
babynus
(@babynus)
Posts: 14953
Main Contributor Admin
 

Yes


 
Posted : 15 Dec 2014 0H20
Share:

Scroll to Top