MySQL: UTF-8 compatibility bug
  • rzelnikrzelnik January 2009

    Hi all,
    Simple Invoice uses UTF-8 as a default encoding. That's great. But if you save any accented character (

  • justinjustin January 2009

    Hey Robert,

    thanks for the post

    so even with DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci for each table in the .sql files for db creation its not enough?

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • justinjustin January 2009

    just tested it - your right mysql doesnt store those characters correctly

    question: if you do a PDF for an invoice with those characters does it come out OK?

    below is the PDO code - i'll include this in the next release if testing is OK

    $connlink = new PDO(
    $pdoAdapter.':host='.$config->database->params->host.'; dbname='.$config->database->params->dbname, $config->database->params->username, $config->database->params->password, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
    );


    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • rzelnikrzelnik January 2009

    > so even with DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci for each table in the .sql files for db creation its not enough?

    no, that just says how the MySQL stores the data and how it orders them during db requests.

    SET NAMES 'charset_name'
    SET CHARACTER SET charset_name

    this specifies in which encoding the PHP communicates with the database.
    I don't know exactly the difference between NAMES and CHARACTER SET, IMHO it would be better to set both of them.

    regarding PDF: checked, works well, also XLS and DOC export.

  • justinjustin January 2009

    Thanks Robert

    I've set those 2 properties in our demo site http://www.simpleinvoices.org/demo

    if you can login and let me know if all is OK it would be great - also try doing some PDFs - we've had lots of problems in the past with non-latin and PDF

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • rzelnikrzelnik January 2009

    Hello Justin,
    I have created a testing invoice and a testing product with some Slovak accented characters. They sill appear damanged.


    http://www.simpleinvoices.org/demo/index.php?module=products&view=details&id=189&action=view

    Note that the processing of non-latin characters includes many levels. The communication between db & app is just one of them. Other level is processing in WYSIWYG editor. For example in my local installation everything works well, except texts stored via WYSIWYG. I assume you use TinyMCE. I have some notes regarding TinyMCE & UTF compatibility. It's not so easy to force TinyMCE to process non-latin chars, but it is possible. Anyway I suggest to resolve the db level first.

  • don_camillodon_camillo January 2009

    I also tested new PDF system. It is really great. In Turkish we have 7 special characters and as i tested now 4 of them are working but still 3 character are not shown properly.
    See the Invoice 586 for problem.

    Working characters are:

  • justinjustin January 2009

    hey don

    re new pdf
    - did you test the same characters in the old pdf system?

    re how to post them
    - use the html codes for the characters to print them - and select bbcode as the post type

    let us know how you go

    cheers

    justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • don_camillodon_camillo January 2009

    Sorry it is my mistake. I now realized that my template which i am already using for months has do not have any problem about Turkish characters. (I am using Beta 1)

    But now i am begin to afraid. will it be a problem in the next version?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

Categories