Categories > OpenTBS with ODT >

charset OpenTBS

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Andries
Date: 2013-04-24
Time: 09:20

charset OpenTBS

Hi,

I have a problem with switching charsets and especially with exended ascii characters (such as an euro sign). I can't get the eurosign to show up in my odt.

The data that I try to merge is in format UTF-8. This is what I tried so far:

1) $tbs->LoadTemplate($template, 'UTF-8'); ==> I think this doesn't do anything, can this be a bug?
2) $tbs->SetOption('charset', 'UTF-8') ==> same result

3)
iconv("UTF-8", "CP1252", $value) ==> works for the normal ascii characters, but not the extended
I also tried the known workaround: str_replace(chr(0xC2).chr(0x80), chr(0xE2).chr(0x82).chr(0xAC), $value), but normally iconv also translates extended ascii characters.

The eurosign never pops up. What am I doing wrong :)?

Thanks,
Andries
By: Skrol29
Date: 2013-04-24
Time: 11:46

Re: charset OpenTBS

Hi Andries,

With OpenTBS, use:
$tbs->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
and that's all, no SetOption().
By: Andries
Date: 2013-04-24
Time: 11:49

Re: charset OpenTBS

Thanks Skrol, works perfect!