What Do You Need In The Xf2 Xengallery Version? Vote for your choices here: http://www.sonnb.com/threads/what-do-you-need-in-the-xf2-xengallery-version.1539/

Help Can Charset Be Set In The Importer?

Discussion in 'XenGallery' started by emrcia, Oct 31, 2016.

  1. emrcia

    emrcia Authorized Member Authorized

    Hi

    I'm trying to migrate a spanish gallery and there are some characters that are imported with strange symbols.
    Your gallery addon doesn't allows me to set the charset (like latin 1). Could you please provide a fix for this?

    Thank you
     
  2. sonnb

    sonnb Administrator Staff Member

    Hello,

    Does it work for your thread and post? Because I also see XF use utf8 as default. You can change the charset of table and field to which you want to.
     
  3. emrcia

    emrcia Authorized Member Authorized

    The vBulletin forum was using latin 1. Could you please provide the steps to change table charset in a safe way so?
     
  4. sonnb

    sonnb Administrator Staff Member

    The charset is declared together with the tables in the library/sonnb/XenGallery/Install.php file. Unfortunately you have edit manually. Btw, since XenForo also uses the utf8_unicode as default, did you have to change it yourself too?
     
  5. emrcia

    emrcia Authorized Member Authorized

    I'm trying to import from PhotoPost Pro 8.4 and album categories are latin1

    When I imported vB to XF I set charset as latin1. However when I import photopost albums accents look fine in PP database but in XF they look pretty bad:
    Bases y centros de coordinación

    I definitely need a way to force the character set to "latin1" just like XenForo allows.
     
  6. sonnb

    sonnb Administrator Staff Member

    Actually this need to be done in the Importer. Currently there is no charset field that allows you to input the current DB charset while importing from PhotoPost (from vBB does have). I must add this to make this works.

    In the mean time, you can do a workaround to make the text works. No need to change the encoding, just add following line to the file library\sonnb\XenGallery\Importer\PhotopostProVb.php line 160:
    PHP:
    $this->_charset 'latin1';
    Reimport and see how it works.
     
  7. Arboristsite

    Arboristsite Authorized Member Authorized

    Still the same...categories are imported in this way:
    Line 160 is the following one. Please check if it's fine:
    Code:
        protected function _bootstrap(array $config)
        {
            $this->_bootstrapXenGallery($config);
            $this->_charset = 'latin1';
        }
     
  8. sonnb

    sonnb Administrator Staff Member

    It should be:

    $this->_charset = 'latin1';

    Without the [ B] thing.
     
    Last edited: Nov 23, 2016
  9. Arboristsite

    Arboristsite Authorized Member Authorized

    I edited the post after I noticed the mistake. Issue still
     
  10. sonnb

    sonnb Administrator Staff Member

    I have just searched around. The correct charset name to be used in the code should be ISO-8859-1 instead of latin1.

    Therefore it must be: $this->_charset = 'ISO-8859-1';

    Could you give it a try?
     
  11. Arboristsite

    Arboristsite Authorized Member Authorized

    Same problem. Characters are still being imported like this
    instead of this
     
  12. Arboristsite

    Arboristsite Authorized Member Authorized

    I've sent you a private message with log in details so you can check the database and resolve this issue.
     
  13. sonnb

    sonnb Administrator Staff Member

    OK. I will look on it. For your information, I also have just updated the importer with ability to set the charset during the import without requiring to change the code. It will be available in the next update.
     
  14. Arboristsite

    Arboristsite Authorized Member Authorized

    Thank you. However if the changes I made didn't work I guess you will have to check the database and see why I can't resolve this
     
  15. sonnb

    sonnb Administrator Staff Member

    Sure. I will absolutely help you out of this issue.
     

Share This Page