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!

---------------------------------------------



hello

i have the following stored function

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

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 "articles.name" 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
19201
November 20, 2006 04:46AM
4885
November 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.