News:

Looking for documentation? Take a look on our wiki

Main Menu

[FIXED] Bug if use accentuated letter in category name

Started by sonance, December 16, 2007, 13:37:06 PM

Previous topic - Next topic

sonance

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


Soeren

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
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

greyow

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:

  • 'duplasoros karöto'
  • 'duplasoros kark öto'

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

thx
greyow

sonance

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


sonance

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 :)

greyow

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 :
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.

greyow

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


sonance

#10
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 :)