Opened 6 years ago

Closed 6 years ago

#1335 closed defect/bug (fixed)

Localized navigational messages are broken on Android Lollipop

Reported by: tryagain Owned by: KaZeR
Priority: major Milestone:
Component: core Version: git master
Severity: normal Keywords:


While working on #1331, we have discovered that Russian navigational messages on Lollipop emulator are broken too. Route description in internal GUI shows route distance and time in the first line, followed by a number off empty (but selectable) lines.

It looks like translated format strings, when passed to printf()-like function, are truncated on the first non-7-bit-ASCII character.

Solution for #1331 doesn't work here because we have lots of translated strings containing printf()-style argument references.

Change History (3)

comment:1 Changed 6 years ago by tryagain

It appears, bionics (C runtime library used on Android) since Lollipop attempts to support locale.

Instead of working with full 8-bit range of characters in format strings, it now carefully parses the string with mbrtowc().

Everything would be ok for us if it were expecting utf-8 input. Bionics even defaults to utf-8, but something (most probably, in navit itself) makes it switch to 7-bit ASCII.

It appears, bionics' implementation of setlocale() treats all categories as synonyms. So there's only one locale could be set for a given moment of time. And actually there are two possible locales: one supporting utf-8, and 7-bit ASCII one.

It looks like we reset it to 7-bit locale in main.c. We attempt to do it for LC_NUMERIC category only, but due to poor implementation of setlocale() in bioncis, it affects LC_CTYPE too.

Most probably, disabling these calls on Android would fix the problem.

Last edited 6 years ago by tryagain (previous) (diff)

comment:2 Changed 6 years ago by tryagain

I have committed a fix with R6372

With that commit, I also have reverted changes of #1331, because its underlying cause is now fixed.

Tested on 5.1.1 and 4.0.3 emulators.

Last edited 6 years ago by tryagain (previous) (diff)

comment:3 Changed 6 years ago by tryagain

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.