[Solved] Double byte characters in the Title

edited November 2015 in Bugs and Errors
If the title has double byte characters(UTF-8), the link to the video gets broken.

http://mytube.mph.jp/videos/39//

which shoud be like

http://mytube.mph.jp/videos/39/飛行機2/

The database holds the title as follows:

mysql> select title from thisisitvideos where video_id='39';
+--------------+
| title |
+--------------+
| 飛行機2 |
+--------------+

Any idea?

Comments

  • Here's the screen image:
    srcs.png
    635 x 303 - 76K
  • CumulusClips wasn't built with multibyte characters in mind. Our apologies for any inconvenience this results in. Several methods would have to be updated to accommodate for this. Please refer to the following for a list of multibyte in PHP:

    http://php.net/manual/en/ref.mbstring.php

    In your case, /cc-core/lib/Functions.php (Approx. Line 33), you will find the create slug method. You can update this method with the functions from the link above to work with your language. You may do this anywhere else in the codebase as needed.

    Another option is to remove the slug from the URLs altogether.
  • Removing the slug gives me a correct URL that is encoded, but I get "404 Page not found" error.

    I guess that is because the title in the database is decoded. Any more idea?

    Thanks in advance.
  • If you choose to go the route of removing the slug, you must update the routing for the play video page and remove the slug portion of the REGEX pattern in the play page route. This is found in the file: /cc-core/lib/Router.php (Approx. line 166).

    Replace:

    'path' => 'videos/([0-9]+)/[a-z0-9\-]+',

    With:

    'path' => 'videos/([0-9]+)',
  • Thank you for your prompt reply,Damian. I will test it later today.
  • Damian,
    It didn't work. I'd like to find out the cause of the error. Could you give me where it throws 404 error when the video is not found?
    Motenote
  • I think I solved the problem. I replaced

    'path' => 'videos/([0-9]+)/[a-z0-9\-]+',

    with

    'path' => 'videos/([0-9]+)/.*',

  • This has been fixed in v2.2.1. The slug in the URL of the video play page is now optional, fixing this issue.
This discussion has been closed.