Results 1 to 4 of 4

Thread: Need to change template charset, problem with characters

  1. #1
    Join Date
    Feb 2005
    Location
    BiH
    Age
    40
    Posts
    811

    Default Need to change template charset, problem with characters

    Here is my situation:

    My templates (frontend and admin) are set to: iso-8859-2
    In control panel: Character set: UTF-8; Default language: en

    As there was a problem for me with charset in OR: (when I go to edit listing I get strange characters in editor) I made small modification as proposed from few leading developer/supporters on this forum:

    Code:
    FILE: include/listing_editor.php
    Line 558: $sql_feature_insert = $misc->make_db_safe(html_entity_decode($feature_insert, ENT_COMPAT, $config['charset']));
    changed to:
    $sql_feature_insert = $misc->make_db_safe($feature_insert);
    Code:
    FILE: include/forms.inc.php
    Comment Line 39: $field_value=htmlentities($field_value, ENT_COMPAT, $config['charset']);
    Code:
    FILE: include/search.inc.php
    Comment all 5 instances of: $f = htmlspecialchars($f, ENT_COMPAT, $config['charset']);
    So I guess that every data inserted into mysql database using OR admin is inserted in iso-8859-2.

    MySQL config:
    MySQL charset: UTF-8 Unicode (utf8)
    MySQL connection collation: utf8_general_ci

    OK, that my current configuration.

    Now I want to change my templates to UTF-8, because I have XML importer addon, that imports listings in UTF-8.

    When I change my templates to UTF-8, listings imported with XML importer looks OK, but existing listing in database have problem with strange characters.

    If I open page in iso-8859-2, than data from database are displayed OK, but other characters in template are wrong (as I changed to utf-8), and also imported listing are wrong.

    How can I solve this situation?

    Should I do some kind of data transformation in MYSQL? Which tool to use?

    This is my first step in preparation for OR 3.0.

    Thank you for any suggestion.

    Regards

  2. #2
    Join Date
    Feb 2005
    Location
    BiH
    Age
    40
    Posts
    811

    Default Re: Need to change template charset, problem with characters

    OK, I solved this, so you can lock.

    Exported database. Use Notepad+ to find/replace all chars with new.

    Imported again. Now everything is UTF-8.

  3. #3
    Join Date
    Mar 2006
    Location
    Rijeka, Croatia
    Posts
    168

    Default Re: Need to change template charset, problem with characters

    I had the same problem. I think that you should also check with phpmyadmin if čćžšđ are displayed correctly in database after you fixed it.

    BTW, which XML importer addon are you using? And can it be used to import listings from different OR sites?

  4. #4
    Join Date
    Feb 2005
    Location
    BiH
    Age
    40
    Posts
    811

    Default Re: Need to change template charset, problem with characters

    As I said, problem is solved, can be locked.

    p.a. When find/replace use this codes in mysql dump file: http://www.thesauruslex.com/typo/eng/enghtml.htm

Similar Threads

  1. Problem with charset / translation
    By Pinger in forum Language File Releases (CLOSED)
    Replies: 13
    Last Post: 05-07-2009, 05:51 AM
  2. charset problem in template
    By bikeman in forum Installation/Configuration Help (CLOSED)
    Replies: 2
    Last Post: 02-02-2008, 07:11 AM
  3. charset problem in 243
    By bit in forum General Help (CLOSED)
    Replies: 6
    Last Post: 10-09-2007, 10:55 AM
  4. xinha language charset problem
    By pettypoh in forum General Help (CLOSED)
    Replies: 1
    Last Post: 06-15-2006, 10:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •