Development

#1565 ([PATCH] Text helper works wrong with Unicode)

You must first sign up to be able to contribute.

Ticket #1565 (closed defect: fixed)

Opened 1 year ago

Last modified 2 months ago

[PATCH] Text helper works wrong with Unicode

Reported by: Andrew.Tchircoff Assigned to: dwhittle
Priority: minor Milestone:
Component: helpers Version: 1.0.0
Keywords: Unicode Cc:
Qualification: Patch rejected, quality issue

Description

truncate_text and excerpt_text produce garbaged output when used utf-8 strings. The reason is that these helpers are not using mbstring extension - in fact, non-multibyte safe functions like strlen are used. The appropriate patch is attached.

Attachments

TextHelper.patch (1.4 kB) - added by Andrew.Tchircoff on 03/13/07 08:42:25.
Text helper patch

Change History

03/13/07 08:42:25 changed by Andrew.Tchircoff

  • attachment TextHelper.patch added.

Text helper patch

10/01/07 08:20:02 changed by dwhittle

  • qualification set to Ready for core team.

While I agree this is the right thing to do, should we introduce mb string dependency?

10/01/07 08:24:12 changed by dwhittle

Possible solution in dwhittle branch, changeset #5335

10/01/07 09:27:02 changed by Andrew.Tchircoff

Yes, I think, just because in terms of internationalization php_mbstring is an obligatory requirement for all modern frameworks/applications. Symfony now is using relatively rare extensions for parsing DOM tree, and additional dependency to common extension such as mbstring will not be a breaking change.

10/01/07 09:35:24 changed by dwhittle

I agree mb_string dependency is needed, I wanted to note the concern and make sure it was a conscious decision.

10/11/07 19:06:30 changed by fabien

  • qualification changed from Ready for core team to Patch rejected, quality issue.

No, I think we need a solution that uses mbstring if available and use standard php functions if not. I don't want to introduce new dependencies in symfony 1.0.

If you can rework the patch taking this into account, I will commit the patch.

04/22/08 23:01:51 changed by dwhittle

  • owner changed from fabien to dwhittle.
  • status changed from new to assigned.

I think we should introduce mb_string dependency for 1.1 -- it makes sense given i18n layer.

04/29/08 09:53:53 changed by FabianLange

i also think that we should depend on mb_string. working without and i18n is a pain

05/20/08 00:02:53 changed by dwhittle

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in r9062.