Opened 14 years ago

Closed 14 years ago

#6603 closed bug (fixed)

[Installer] not enough chars to store translated string (patch)

Reported by: diver Owned by: anevilyak
Priority: normal Milestone: R1
Component: Applications/Installer Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

This is hrev38644.

If you select Russian locale in ReadOnlyBootPrompt and then start Installer you'll see question marks in the black diamonds in the drop down menus. See screenshot.

Attachments (2)

installer.png (36.3 KB ) - added by diver 14 years ago.
installer.diff (453 bytes ) - added by diver 14 years ago.
possible patch

Download all attachments as: .zip

Change History (10)

by diver, 14 years ago

Attachment: installer.png added

comment:2 by diver, 14 years ago

patch: 01

by diver, 14 years ago

Attachment: installer.diff added

possible patch

comment:3 by korli, 14 years ago

It seems ok to be applied.

comment:4 by anevilyak, 14 years ago

Owner: changed from korli to anevilyak
Status: newin-progress

comment:5 by anevilyak, 14 years ago

Resolution: fixed
Status: in-progressclosed

Applied in hrev38647. Thanks!

comment:6 by siarzhuk, 14 years ago

Resolution: fixed
Status: closedreopened

Aren't those "black diamonds" the sign that current implementation of "string_for_size" function is buggy? Looks like the string was just cut out regardless of real character boundaries. UTF-8 is not fixed-size symbol encoding. And much more elegant solution would be translating with "..." at end in case proposed buffer is not enough, IMO. Anyway this is a partial solution and I'm not sure, that 20 bytes "will be enough" for any language. ;-)

comment:7 by siarzhuk, 14 years ago

By the way another potential place for the same problem:

src/kits/tracker/InfoWindow.cpp

1548                 char capacityStr[16], usedStr[16], freeStr[16];
1549                 string_for_size(capacity, capacityStr, sizeof(capacityStr));
1550                 string_for_size(capacity - fFreeBytes, usedStr, sizeof(usedStr));
1551                 string_for_size(fFreeBytes, freeStr, sizeof(freeStr));

Other occuriences of using "string_for_size" are using either 1024 or 128 bytes for result buffer. ;-)

comment:8 by korli, 14 years ago

Resolution: fixed
Status: reopenedclosed

To me, if the bug reporter tested the patch OK, it is good enough. Please create a more general bug for the string_for_size() API problem.

Note: See TracTickets for help on using tickets.