Moodle

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

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9
  • Fix Version/s: STABLE backlog
  • Component/s: Course, General
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

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.

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

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

Show
Eloy Lafuente (stronk7) added a comment - 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
Hide
Charles Kelly added a comment -

Re: and where exactly are you getting that problem?

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

Show
Charles Kelly added a comment - Re: and where exactly are you getting that problem? I can see this when adding child courses to a meta course

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated: