OpenTBS and UTF-8

205 views
Skip to first unread message

Ivan Krechetov

unread,
Mar 30, 2010, 1:31:53 AM3/30/10
to TinyButStrong Next Version
In OpenTBS 1.1, tbs_plugin_opentbs.php, on line 250:

$x = htmlspecialchars(utf8_encode($Txt));

Why utf8_encode? In our application everything is in UTF-8, and that
utf8_encode makes me convert the values to Latin-1 when merging them
with an ODT template.

Shouldn't the charset dependency be explicit?

Skrol29

unread,
Mar 30, 2010, 11:05:44 AM3/30/10
to tbs-...@googlegroups.com
Hi,

I agree. TBS usually enables you to choose the charset for default string
conversion in the template. That is the purpose of the second argument of
LoadTemplate() method. But with the Open-TBS plug-in, the string conversion
is forced to UTF-8.

I will rehabilitate the string conversion changing feature in Open-TBS. I
thing the default conversion will stay Ansi->UTF8 in order to ensure the
compatibilty.

Before the fix, you can workaround this problem by adding
$TBS->LoadTemplate('', array(&$this,'MyConversionFunction'));
just after the $TBS->LoadTemplate() common call.
'MyConversionFunction' must be a custom function that does perform both
string conversion and new line conversion, as described in the manual here :
http://www.tinybutstrong.com/manual.php#php_loadtemplate

Have a nice day,
---------------------
Skrol29
www.tinybutstrong.com
---------------------

-----Message d'origine-----
De : tbs-...@googlegroups.com [mailto:tbs-...@googlegroups.com] De la part
de Ivan Krechetov
Envoyé : mardi 30 mars 2010 07:32
À : TinyButStrong Next Version
Objet : [tbs-next] OpenTBS and UTF-8

$x = htmlspecialchars(utf8_encode($Txt));

--
You received this message because you are subscribed to "TinyButStrong next
version".
Post to this group: send email to tbs-...@googlegroups.com
Subscribe: send email to tbs-next+...@googlegroups.com
Unsubscribe: send email to tbs-next+u...@googlegroups.com
More options: http://groups.google.com/group/tbs-next

To unsubscribe from this group, send email to
tbs-next+unsubscribegooglegroups.com or reply to this email with the words
"REMOVE ME" as the subject.

Reply all
Reply to author
Forward
0 new messages