VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Quality & Testing VirtueMart 1.1.x => Virtuemart 1.1 Development (Archiv) => Q&T Resolved => Topic started by: sonance on December 16, 2007, 13:37:06 PM

Title: [FIXED] Bug if use accentuated letter in category name
Post by: sonance on December 16, 2007, 13:37:06 PM
Sorry for my bad English :P

Description:

if use accentuated letter in category name or product name the category and product pictures dont work!

VirtueMart Version:

1.1beta2

Joomla/Mambo Version:

1.5RC3

Steps to replicate:

use accentuated letter in category name or product name the category and product pictures dont work!

Proposed fix(es):

The system NOT convert the accentuated letters to normal in image names!!! Pls fix it!

Bugtracker task #:

System info:

Win XP SP2
Apache Web Server Version 2.2.4
PHP Script Language Version 5.2.1
MySQL Database Version 5.0.27
phpMyAdmin Database Manager Version 2.9.2
Title: Re: Bug if use accentuated letter in category name
Post by: aravot on December 16, 2007, 20:52:59 PM
Give an example of letter, word.
Title: Re: Bug if use accentuated letter in category name
Post by: Soeren on December 17, 2007, 20:55:41 PM
I think this is fixed now. Could someone please check it?

I used the product name "Chñain Saw" for testing. Set the product name and after that upload new product images. They should be displayed correctly now.

ciao, Sören
Title: Re: Bug if use accentuated letter in category name
Post by: greyow on December 18, 2007, 11:18:57 AM
I have a probem with accented chars in product name
too but it's only if the accented char there's in the 16th position.

system info:
joomla: 1.5
virtuemart: 1.1.0 beta2 (1090 Complete Package )
mysql: 5.0.45
webserver: Apache/1.3.34 (Debian) PHP/4.4.4-9+lenny1 mod_fastcgi/2.4.2


Description:
product name: duplasoros karköto
file name: 00100090.jpg

it puts the data in mysql table:
jos_vm_product.product_full_image = 'duplasoros_kark'

there is in mysql log file:
INSERT INTO `jos_vm_product` ( ... `product_name` ... `product_full_image`, ... ) VALUES ( ... ,'duplasoros karköt' ... ,'duplasoros_kark�_47679678a3c1d.jpg' .. );

I can run INSERT in mysql on console, and it's correct.

If accented char is not 16th position, it will work correct.
good names:

finally: There isn't this problem in 1.0.13a version.

thx
greyow
Title: Re: Bug if use accentuated letter in category name
Post by: sonance on December 18, 2007, 23:38:14 PM
Quote from: aravot on December 16, 2007, 20:52:59 PM
Give an example of letter, word.

try to use this Hungarian word: tükörfúrógép
Title: Re: Bug if use accentuated letter in category name
Post by: aravot on December 19, 2007, 00:50:55 AM
Did you try the latest nightly build (http://forum.virtuemart.net/index.php?topic=31381.0), it seems Soeren has fixed the issue.
Title: Re: Bug if use accentuated letter in category name
Post by: sonance on December 19, 2007, 09:15:23 AM
Quote from: Soeren on December 17, 2007, 20:55:41 PM
I think this is fixed now. Could someone please check it?

I used the product name "Chñain Saw" for testing. Set the product name and after that upload new product images. They should be displayed correctly now.

ciao, Sören

Thanks for quick-fix I'll try :)
Title: Re: Bug if use accentuated letter in category name
Post by: greyow on December 20, 2007, 14:35:37 PM
Hi again,

I think I have known what my problem.

I use the utf-8 charset.

imageTools.class.php
vmImageTools::validate_image
$filename = substr( $d[$table_name.'_name'], 0, 16 );

perhaps it splits half the accentuated letter. ( accentuated chars of utf8 aren't 8 bit )

on php site  (http://www.php.net/manual/en/language.types.string.php):
QuoteIn PHP, a character is the same as a byte, that is, there are exactly 256 different characters possible. This also implies that PHP has no native support of Unicode. See utf8_encode()  and utf8_decode() for some Unicode support.
Title: Re: Bug if use accentuated letter in category name
Post by: greyow on December 23, 2007, 00:17:09 AM
my solution:
/administrator/components/com_virtuemart/classes/imageTools.class.php

105            $filename = utf8_substr( $d[$table_name.'_name'], 0, 16 );
222            $filename = utf8_substr( $d[$table_name.'_name'], 0, 16 );


http://api.joomla.org/elementindex_utf8.html
Title: Re: Bug if use accentuated letter in category name
Post by: aravot on January 03, 2008, 23:33:07 PM
Could you please try it with latest nightly build of Joomla and VirtueMart and give feedback, thank you.
Title: Re: Bug if use accentuated letter in category name
Post by: sonance on January 05, 2008, 14:23:15 PM
Checked the latest Nightly (2008-01-05) and the bug is the same

If i use an accentuated char in the category name the category picture name is not converted standard chars.

Example:

Category name: Tápegységek

/components/com_virtuemart/shop_image/category/T%C3%A1pegys%C3%A9gek_477f73ca06dae.jpg < this picture isn't appear on public frontend, the name is not too browser-compatible! :P
/components/com_virtuemart/shop_image/category/tapegysegek_477f73ca06dae.jpg < i think this is the ideal :)
Title: Re: Bug if use accentuated letter in category name
Post by: aravot on January 22, 2008, 21:46:20 PM
Fixed in revision 1175