Skip to content

Conversation

@l
Copy link

@l l commented May 23, 2012

Hi,

"/\s*/" based word wrapping is not working with Japanese context.
Because usually Japanese string doesn't contain any white spaces in
context.

I added line folding code (based on Text::LineFold). It works fine
with English and Japanese context.

Regards,

AYANOKOUZI, Ryuunosuke

AYANOKOUZI, Ryuunosuke i38w7i3@yahoo.co.jp

@treyharris
Copy link
Owner

Hey there—

I'm so sorry I haven't replied to this... I truly don't understand how I didn't see it, as I've replied to other GitHub issues in the meantime. But this is the first time I'm seeing this patch.

You've likely moved on now, but in case you haven't, I'll be happy to merge given a couple things:

  1. You need to add test cases with CJK text. I, alas, am not qualified; 大学で、私は日本語を勉強しました。しかし、すべてを忘れてしまった。。:-) Otherwise, I'd merge this, even if you have given up.
  2. The SYNOPSIS as rewritten suggests that setting all that stuff is required. The synopsis for a CPAN module is supposed to just show the minimal required to usefully use a module. I can rewrite it if you like if you want to do the test cases.

@l
Copy link
Author

l commented Jun 21, 2014

Hi treyharris,

Thanks for reply. According to your suggestion...

  1. Added test case for CJK text.
    It looks too much, but I think it's good for example. The text is taken from perlintro.
  2. Modified $shoulebe literal for 1st test case
    After commit 9a7d97d, line folding is performed based on Unicode Line Breaking Algorithm (via Unicode::LineBreak). So, new result does not exactly match with previous one. If you don't like this behavior, we need more discussion.

Regards,
AYANOKOUZI, Ryuunosuke

@rjbs
Copy link

rjbs commented Jun 25, 2023

This looks great, and is probably a much better version of a patch I have applied locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants