Issue Details (XML | Word | Printable)

Key: MDL-14230
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Martin Dougiamas
Reporter: Charles Kelly
Votes: 1
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Truncating of Japanese strings (2-byte characters) is wrong.

Created: 06/Apr/08 03:21 PM   Updated: 26/Nov/09 12:22 AM
Component/s: Course, General
Affects Version/s: 1.9
Fix Version/s: 1.9.8

File Attachments: None
Image Attachments:

1. 2-byte-character-truncating-error.gif
(1 kB)

Participants: Charles Kelly, Eloy Lafuente (stronk7) and Martin Dougiamas
Security Level: None
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide

I think that you either need to make the limit for the number of characters 1 greater or 1 less. If you do so the string will be truncated correctly.

What's happening is that we are getting 1/2 a character instead of a full one.

My guess is that other languages using 2-byte characters are having the same problem.

I can see this when adding child courses to a meta course. (image attached.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) added a comment - 07/Apr/08 06:35 AM
Hi Charles,

and where exactly are you getting that problem?

I guess it's because we are using substr() or similar functions in that place where we shoudl be using their utf-8-safe textlib counterparts.

Mathieu, can you, once we know where ?

Ciao


Charles Kelly added a comment - 08/Apr/08 10:42 AM
Re: and where exactly are you getting that problem?

I can see this when adding child courses to a meta course