View Issue Details

IDProjectCategoryView StatusLast Update
0011207LazarusLCLpublic2013-09-26 18:26
ReporterWhiteWind Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformi386OSLinux 
Summary0011207: Invalid handling of non-english characters in filenames
DescriptionSee attached example. Try to open a folder with non-english characters (e.g Директория). When you enter the directory in the dialog, the result is wrong, but if you open dialog again and go up by one level (previous directory becomes selected) and click OK, it works, but sometimes ? sign is placed at the end of the string in the TEdit.
Tagsgtk2
Fixed in Revision42947
LazTarget1.2
WidgetsetGTK 2
Attached Files

Relationships

related to 0011181 closedFelipe Monteiro de Carvalho TFileListBox does not handle non-english characters 
related to 0011454 closedVincent Snijders Problem handling UTF8 file and directory names 
related to 0019483 closedJuha Manninen Lazarus cannot build to a directory which has unicode characters in its name 
related to 0020835 closedBart Broersma ExpandFileNameUTF8 broken 

Activities

2008-04-25 18:36

 

TestProject.tar.bz2 (2,187 bytes)

Felipe Monteiro de Carvalho

2008-04-26 00:50

developer   ~0019079

Please retest with latest Lazarus subversion.

WhiteWind

2008-04-26 12:06

reporter   ~0019087

Nothing changed. Bug still exists

Mattias Gaertner

2008-04-26 12:28

manager   ~0019088

I used the test project, created the folder with above name, created some files with non ascii names and started project. I choose the directory and everything seems to work fine.

What is your system language? Open a terminal and type
echo $LC_ALL
echo $LC_MESSAGES
echo $LANG

WhiteWind

2008-04-26 19:56

reporter   ~0019091

I'll give you more: (pay attention on LANG, LC_NUMERIC and LC_MESSAGES)
# locale
LANG=en_US
LC_CTYPE=ru_RU.koi8r
LC_NUMERIC=POSIX
LC_TIME=ru_RU.koi8r
LC_COLLATE=ru_RU.koi8r
LC_MONETARY=ru_RU.koi8r
LC_MESSAGES=POSIX
LC_PAPER=ru_RU.koi8r
LC_NAME=ru_RU.koi8r
LC_ADDRESS=ru_RU.koi8r
LC_TELEPHONE=ru_RU.koi8r
LC_MEASUREMENT=ru_RU.koi8r
LC_IDENTIFICATION=ru_RU.koi8r
LC_ALL=

Now I will try to set LC_ALL to ru_RU.koi8r and test again.

But the same bug occurs in win32, which has not locale

WhiteWind

2008-04-26 20:15

reporter   ~0019092

Well...
$ locale
LANG=ru_RU.koi8.r
LC_CTYPE="ru_RU.koi8r"
LC_NUMERIC="ru_RU.koi8r"
LC_TIME="ru_RU.koi8r"
LC_COLLATE="ru_RU.koi8r"
LC_MONETARY="ru_RU.koi8r"
LC_MESSAGES="ru_RU.koi8r"
LC_PAPER="ru_RU.koi8r"
LC_NAME="ru_RU.koi8r"
LC_ADDRESS="ru_RU.koi8r"
LC_TELEPHONE="ru_RU.koi8r"
LC_MEASUREMENT="ru_RU.koi8r"
LC_IDENTIFICATION="ru_RU.koi8r"
LC_ALL=ru_RU.koi8r

Problem still persists. Edit box shows '?' (question marks) instead of cyrillic characters and FileListBox shows no files...

Mattias Gaertner

2008-04-26 20:16

manager   ~0019093

Ok. I have an UTF-8 system. Maybe that's the difference.
Please add the cwstring unit to your lpr and test again.

WhiteWind

2008-04-26 21:26

reporter   ~0019095

Nop. The result is same.
I guess that OpenDirectoryDialog (or what name does this dialog have?) returns filename in system encoding, but edit box and FileListBox expect utf-8 encoding...

Felipe Monteiro de Carvalho

2008-06-09 04:44

developer   ~0020045

Exactly. This isn't a bug, it's the way LCL and the Free Pascal RTL work.

It's all documented here:

http://wiki.lazarus.freepascal.org/LCL_Unicode_Support

WhiteWind

2008-06-09 05:37

reporter   ~0020047

But this is not the problem of filesystem<->LCL encoding convertions. This is the problem of TDirectoryEdit: it should display selected directory name properly. BTW, this project works fine on win32.

Ales Katona

2008-06-26 17:07

developer   ~0020381

Works for me in linux, and seems people think it works in win32 too (I can't confirm that). Can you please re-test with latest trunk?

WhiteWind

2008-06-27 06:43

reporter   ~0020405

Still does not work. Are you using utf8 locale? It works fine with utf8, but it doesn't work with e.g. koi8-r.

Oleg Sharonov

2008-06-28 11:08

reporter   ~0020434

I have the similar problem in windows with lazarus TOpenDialog component. If I set the Options to ofFileMustExist and try to open file with cyrillic name, the component itself shows 'File must exist' - 'The file ... does not exist.' Everything works ok with latin named files.

Vincent Snijders

2008-06-28 11:36

manager   ~0020435

Report a separate issue for what has been described in note 20434.

Ales Katona

2008-06-28 11:36

developer   ~0020436

Hmm, yes I'm on utf8 slovak. Will try to change that and see what happens.

Vincent Snijders

2008-06-28 20:52

manager   ~0020444

Oleg Sharonov, please test with r15606 or later.

Zeljan Rikalo

2009-04-22 16:08

developer   ~0026938

Anyone can reproduce this one ? - it works for me

WhiteWind

2009-04-28 09:27

reporter   ~0027143

Last edited: 2009-04-28 09:28

I confirm that the bug still persists with ru_RU.koi8-r locale.
Lazarus r19236

Juha Manninen

2013-05-01 09:09

developer   ~0067306

Lazarus trunk has fixed many Unicode issues. Is this still a valid issue?

Bart Broersma

2013-08-18 00:33

developer   ~0069433

Last edited: 2013-08-18 00:37

View 2 revisions

On win32 widgetset we translate the result we get from windows to UTF8.
AFAICS we do not do that on GTK widgetset (Linux, using gtk_file_chooser_get_filenames)?
Zeljan?

Juha Manninen

2013-08-19 22:56

developer   ~0069451

Bart, you can assign this to yourself if you like. I don't know how to solve it.

Bart Broersma

2013-08-20 00:53

developer   ~0069452

Zeljan knows about GTK2.

Juha Manninen

2013-08-22 10:52

developer   ~0069487

I must detach myself from this ...

Issue History

Date Modified Username Field Change
2008-04-25 18:36 WhiteWind New Issue
2008-04-25 18:36 WhiteWind File Added: TestProject.tar.bz2
2008-04-25 18:36 WhiteWind Widgetset => GTK 2
2008-04-26 00:48 Felipe Monteiro de Carvalho Tag Attached: gtk2
2008-04-26 00:49 Felipe Monteiro de Carvalho Relationship added related to 0011181
2008-04-26 00:50 Felipe Monteiro de Carvalho LazTarget => -
2008-04-26 00:50 Felipe Monteiro de Carvalho Note Added: 0019079
2008-04-26 00:50 Felipe Monteiro de Carvalho Status new => feedback
2008-04-26 12:06 WhiteWind Note Added: 0019087
2008-04-26 12:28 Mattias Gaertner Note Added: 0019088
2008-04-26 19:56 WhiteWind Note Added: 0019091
2008-04-26 20:15 WhiteWind Note Added: 0019092
2008-04-26 20:16 Mattias Gaertner Note Added: 0019093
2008-04-26 21:26 WhiteWind Note Added: 0019095
2008-05-23 11:48 Vincent Snijders LazTarget - => 1.2
2008-05-23 11:48 Vincent Snijders Status feedback => acknowledged
2008-06-09 04:44 Felipe Monteiro de Carvalho Status acknowledged => resolved
2008-06-09 04:44 Felipe Monteiro de Carvalho Resolution open => not fixable
2008-06-09 04:44 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2008-06-09 04:44 Felipe Monteiro de Carvalho Note Added: 0020045
2008-06-09 05:37 WhiteWind Status resolved => feedback
2008-06-09 05:37 WhiteWind Resolution not fixable => reopened
2008-06-09 05:37 WhiteWind Note Added: 0020047
2008-06-09 18:29 Felipe Monteiro de Carvalho Assigned To Felipe Monteiro de Carvalho =>
2008-06-10 00:07 Vincent Snijders Status feedback => acknowledged
2008-06-10 15:47 Felipe Monteiro de Carvalho Relationship added related to 0011454
2008-06-26 17:07 Ales Katona Note Added: 0020381
2008-06-26 17:07 Ales Katona Status acknowledged => feedback
2008-06-27 06:43 WhiteWind Note Added: 0020405
2008-06-28 11:08 Oleg Sharonov Note Added: 0020434
2008-06-28 11:36 Vincent Snijders Note Added: 0020435
2008-06-28 11:36 Ales Katona Note Added: 0020436
2008-06-28 11:36 Ales Katona Status feedback => acknowledged
2008-06-28 20:52 Vincent Snijders Note Added: 0020444
2009-04-22 16:08 Zeljan Rikalo Note Added: 0026938
2009-04-28 09:27 WhiteWind Note Added: 0027143
2009-04-28 09:28 WhiteWind Note Edited: 0027143
2011-06-04 22:03 Juha Manninen Relationship added related to 0019483
2011-12-07 22:43 Juha Manninen Relationship added related to 0020835
2013-05-01 09:02 Juha Manninen Assigned To => Juha Manninen
2013-05-01 09:02 Juha Manninen Status acknowledged => assigned
2013-05-01 09:09 Juha Manninen Note Added: 0067306
2013-05-01 09:09 Juha Manninen Status assigned => feedback
2013-08-18 00:33 Bart Broersma Note Added: 0069433
2013-08-18 00:37 Bart Broersma Note Edited: 0069433 View Revisions
2013-08-19 22:56 Juha Manninen Note Added: 0069451
2013-08-20 00:53 Bart Broersma Note Added: 0069452
2013-08-22 10:52 Juha Manninen Note Added: 0069487
2013-08-22 10:52 Juha Manninen Assigned To Juha Manninen =>
2013-08-22 10:52 Juha Manninen Status feedback => new
2013-09-26 17:03 Mattias Gaertner Fixed in Revision => 42947
2013-09-26 17:03 Mattias Gaertner Status new => resolved
2013-09-26 17:03 Mattias Gaertner Resolution reopened => fixed
2013-09-26 17:03 Mattias Gaertner Assigned To => Mattias Gaertner