MySQL Forums :: Character Sets, Collation, Unicode :: concat and character encoding

Advanced Search

concat and character encoding
Posted by: Christian Trummer ()
Date: November 20, 2006 04:46AM

EDIT -> solved

yeah i got it!!

CAST(`articles`.`number` AS CHAR CHARACTER SET utf8 )

you have to cast int columns to char before concat use!



i have the following stored function

CREATE DEFINER=`root`@`localhost` FUNCTION `getLiveCurrentArticle`(LNR int, INTIME datetime) RETURNS varchar(255)

DECLARE ARTICLE varchar(255);

SET ARTICLE = (select concat(`articles`.`number`, ' - ', `articles`.`name`)
from `articles`
where `articles`.`id` = getLiveCurrentArticleId(LNR, INTIME));

return Convert(ARTICLE using utf8);

all tables, columns, database connection etc is set to utf8 and i use "set names utf8"

when i only get the "" everything is fine and in utf8
but when i use concat to show the article number with the article name i geht a different character set back.
i tried using convert (article using utf8) but nothing is happening

how can i define that i only would get utf8???

Edited 1 time(s). Last edit at 11/20/2006 04:51AM by Christian Trummer.

Options: ReplyQuote

Subject Views Written By Posted
concat and character encoding 15240 Christian Trummer 11/20/2006 04:46AM
Re: concat and character encoding 4252 Franco Zapata 11/20/2008 07:19AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.