vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Product import and character encoding problem (https://vborg.vbsupport.ru/showthread.php?t=325787)

Scandal 11-19-2017 10:53 PM

Product import and character encoding problem
 
Well, we have two boards:
- one in ISO-8859-7 (Greek) / my development board
- and another one in UTF-8

When I export a product from my dev board and import it to the UTF-8 board, there is issue with the Greek characters. :(
They appearing as "???????".

In the other hand, if I import the same product on another ISO-8859-7 board works perfect.

Any idea how to fix it?

Dave 11-19-2017 11:41 PM

Is the encoding of the database with the question marks properly set?

Scandal 11-19-2017 11:52 PM

hmm yes I think so, but how I can detect that it is the correct encoding?

Both boards I noticed works perfect for posting any characters (english / greek). The issue is on the product import where the greek characters inside the template saved as "?????" cause when I visited the page where a template is called, I see "?????" instead of greek chars.

Scandal 11-26-2017 11:47 AM

Any idea? The product I'm trying to import is a bit big, I can't re-build it on the utf-8 board. :(
I need to import it so it will be working as should.

I'm using Notepad++.

In Omnibus 11-26-2017 01:06 PM

Quote:

Originally Posted by Scandal (Post 2591263)
Any idea? The product I'm trying to import is a bit big, I can't re-build it on the utf-8 board. :(
I need to import it so it will be working as should.

I'm using Notepad++.

Have you tried converting the script using iconv?

https://stackoverflow.com/questions/...19843#36619843

Scandal 11-26-2017 01:10 PM

Well, I found a hard-coded solution. :)

1. Open the exported xml with Notepad++
2. Convert it to UTF-8 (Encoding > Encode in UTF-8 > Save)
3. Open file /includes/class_xml.php, then find:
PHP Code:

$xml_encoding = (($in_encoding != 'UTF-8' OR strtoupper($stylevar['charset']) != 'UTF-8') ? 'ISO-8859-1' 'UTF-8'); 

4. Add below:
PHP Code:

$target_encoding 'UTF-8';
$xml_encoding 'UTF-8'

5. Then try to import *xml product via AdminCP.

All ok! :D

6. Undo step #4.

Done :)


All times are GMT. The time now is 10:30 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01098 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete