Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyrillic names in addressbook after windows update (RC 1.3.6) #6299

Closed
crasheg opened this issue May 21, 2018 · 18 comments
Closed

Cyrillic names in addressbook after windows update (RC 1.3.6) #6299

crasheg opened this issue May 21, 2018 · 18 comments

Comments

@crasheg
Copy link

crasheg commented May 21, 2018

Hello, my installation is:

Apache/2.4.33 (Win64) OpenSSL/1.0.2o PHP/7.2.5
libmysql - mysqlnd 5.0.12-dev - 20150407
mysqli,curl, mbstring,intl

After last update windows 10 to 1803 (biuld 17134.48) i have problem with addressbook. All contacts in list shown as empty lines (red line).
image
If i'll try to add new contact with cyrillic letters - in error log i getting DB Error((
image
In MySQL DB contactseverything is fine - cyrillic is cyrillic.
image
I've tried to rollback apache to 2.4.20, php to 7.0, rouncube to 1.30 and everywhere i have same problem.

Any ideas?
Temporary resolve for this problem:

/program/include/rcmail.php

replace line 181

setlocale(LC_ALL, $lang . '.utf8', $lang . '.UTF-8', 'en_US.utf8', 'en_US.UTF-8');

to

setlocale(LC_ALL, 'ru_RU.CP1251', 'rus_RUS.CP1251');

But i think it's no good(

@alecpl
Copy link
Member

alecpl commented May 21, 2018

It looks like it breaks contact's display name. It is generated in rcube_addressbook::compose_display_name() from firstname and surname, but I don't see how it would create such a garbage. In any case lack or broken locale should not cause such issues.

Did you try with disabled all plugins? Use most recent version.

@crasheg
Copy link
Author

crasheg commented May 21, 2018

I use filter in photoshop ))
problem in red line
image
there is no text(
image
but information from this contact in right side are shown!

@alecpl
Copy link
Member

alecpl commented May 21, 2018

There's no need to tell the same story more than once. Answer to the questions or we won't be able to help you.

@crasheg
Copy link
Author

crasheg commented May 21, 2018

Did you try with disabled all plugins? Use most recent version.

Yes, i tried without plugins.
Tried roundcube 1.3.6, 1.3.3, same result((
I think problem in MySQL charset, but as i see - roundcube DB in correct chaarset? May be information shema corrupted?

@alecpl
Copy link
Member

alecpl commented May 22, 2018

This is strange. As I see in the error log when you add a new contact, the surname and firstname is correct but full name is invalid. And this is generated in rcube_addressbook::compose_display_name(). If you'd know PHP a little bit you could do some debug there. On a first look at the code I don't see a problem.

The issue on contacts list is similar, but it might be something different, though the code is almost the same for this part.

@crasheg
Copy link
Author

crasheg commented May 25, 2018

Ok, if i remove

$fn = preg_replace('/\s+/', ' ', $fn);

Contact names shown normally in russian.

@alecpl
Copy link
Member

alecpl commented May 25, 2018

Does it work if you change that line to:

$fn = preg_replace('/ +/', ' ', $fn);

?
Could you add rcube::console($fn); before that line and provide the logs/console file after a test (in unmodified text format)?

@crasheg
Copy link
Author

crasheg commented May 25, 2018

$fn = preg_replace('/ +/', ' ', $fn);

Works fine in this place, and show cyrillic names, but this modification doesn't resolve problem with adding new contact.

@alecpl
Copy link
Member

alecpl commented May 25, 2018

Did you do this in rcube_addressbook::compose_display_name()?

@crasheg
Copy link
Author

crasheg commented May 25, 2018

rcube_addressbook::compose_list_name()

@alecpl
Copy link
Member

alecpl commented May 25, 2018

Then you have to do this in both.

@alecpl alecpl added this to the 1.3.7 milestone May 25, 2018
@crasheg
Copy link
Author

crasheg commented May 25, 2018

It's very strange, but it works! )
Checked adding, deleting, modifying - all ok.
Made same changes in rcube_addressbook::compose_search_name() (line number 640), because while typing name in compose mode, names too was not shown.

@alecpl
Copy link
Member

alecpl commented May 25, 2018

Could you please also check $fn = mb_ereg_replace('[:space:]+', ' ', $fn);?

@crasheg
Copy link
Author

crasheg commented May 25, 2018

))
image
cyrillic names is ok, but....
this contact name is "webmaster" ))
back to $fn = preg_replace('/ +/', ' ', $fn);

@alecpl
Copy link
Member

alecpl commented May 25, 2018

Still I'm unable to reproduce this. What returns setlocale(LC_ALL, 'en_US.utf8') on your system?

How about $fn = preg_replace('/\s+/u', ' ', $fn);?

@crasheg
Copy link
Author

crasheg commented May 25, 2018

echo setlocale(LC_ALL, 'en_US.utf8')

en_US.utf8

$fn = preg_replace('/\s+/u', ' ', $fn);

works fine

@alecpl
Copy link
Member

alecpl commented May 25, 2018

Thanks. Ok, then I think we can stay with /u. I guess that's the same as $fn = mb_ereg_replace('\s+', ' ', $fn).

alecpl added a commit that referenced this issue May 25, 2018
alecpl added a commit that referenced this issue May 25, 2018
@alecpl
Copy link
Member

alecpl commented May 25, 2018

preg_replace() is faster so we'll use that. Fixed.

@alecpl alecpl closed this as completed May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants