• Resolved igsNomad

    (@igsnomad)


    Hi,

    First off thank you for this wonderful plugin! We were so happy when we saw that someone actually took the time to write one.

    Our humble library (made up of about 50 or so books) has some asian books which have no latin characters in their title. When we enter titles with extended latin or UTF8 they later show up as question marks. Are you thinking of adding UTF support or is there something we are missing?

    Thanks for the great work!

    https://wordpress.org/plugins/weblibrarian/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Robert Heller

    (@robertpheller)

    The system should have UTF support. You probably need to be sure your web browser AND web server support UTF and in fact support the same UTF coding. Also, you need to be sure your Word Press install is also supporting UTF.

    Thread Starter igsNomad

    (@igsnomad)

    Thanks for your reply. Our website is multilingual, we use 4 other languages along with English. We have no problems viewing or editing UTF characters site wide.

    But in weblibrarian the problem persists. Well it might not be a problem for everyone, but we would really like to have our books’ names show up correctly.

    On another note, is it possible to have a loan period of 0 days? Because there are some out-of-print books we don’t loan as a rule and it would be easier on our volunteers if we could just have the system say “No, you cant have this book”.

    Plugin Author Robert Heller

    (@robertpheller)

    Well I don’t know what is going wrong. I don’t *think* I need to do anything special to get UTF-8. The code just outputs what is in the database and it is up to the browser to display things properly. WP itself presumably is sending a proper ‘Charset:’ heading, based on how WP is configured. The only possiblity I can think of is the database field types could be wrong. Most of the fields are set to varchar(n), maybe they need to be something else?

    To allow a loan period of 0, you would need to edit database_code.php in the includes sub-directory, changing this method of class WEBLIB_Type:

    function set_loanperiod($days) {
    	  //file_put_contents("php://stderr","*** Type->set_loanperiod($days)\n");
    	  //file_put_contents("php://stderr","*** Type->set_loanperiod(): this->dirty = $this->dirty\n");
    	  if ($days < 1) {
    	    trigger_error("Illegal loan period: $days\n", E_USER_ERROR);
    	  }
    	  $this->theloanperiod = $days;
    	  $this->dirty = true;
    	  //file_put_contents("php://stderr","*** Type->set_loanperiod(): this->dirty = $this->dirty\n");
    	}

    Change the test for the Illegal loan period error.

    Plugin Author Robert Heller

    (@robertpheller)

    Note: allowing a loan period of 0 won’t prevent circulation of the item, it will just make the item due right away and it will just be overdue upon checkout.

    Thread Starter igsNomad

    (@igsnomad)

    Thanks for the remedy.

    As for the UTF problem, when you mentioned the database I took a look and I found the culprit: for some reason the tables were created with Collate: latin1_swedish_ci as default. Changing them to Collate: utf8_general_ci seems to solve the problem. Everything seems to be in working order. Thank you for your support and wonderful plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘UTF support?’ is closed to new replies.