Search

I've got this error:

loadXML(): Input is not proper UTF-8, indicate encoding ! Bytes: 0xF0 0xA2 0xF1 0x90 in Entity, line: 130

for the next part of xml:

<entry id="14">
    <body mode="normal" word-count="0"><p>text</p></body>
    <body mode="raw" word-count="0"><p>text</p></body>
    <title mode="normal" word-count="0" handle="" handle-ru="" handle-en="traders">????????</title>
    <title mode="raw" word-count="0" handle="" handle-ru="" handle-en="traders">????????</title>
</entry>
...
<entry id="20">
    ...
    <parent>
        <item id="14" handle="????????" section-handle="pages" section-name="Pages">????????</item>
    </parent>
</entry>

Parent is defined in section "Pages" as Select Box Link to section "Pages". Also it's using "Language Redirect" and "Field: Multilingual Text" extensions.

What is wrong with it? "Language Redirect"? Or handle-obtaining code in Symphony?

Well... I've discovered that problem is with line

$item->setAttribute('handle', Lang::createHandle($primary_field['value']));

in function appendFormattedElement(...) in extensions/selectbox_link_field/field.selectbox_link.php

there is utf-8 value in the $primary_field['value'] variable, but there is NOT utf-8 value for the Lang::createHandle($primary_field['value'])!

to demonstrate this just append such string to the function:

echo $primary_field['value'].' != '.Lang::createHandle($primary_field['value']).';';

So, now my question is: where is "Lang::createHandle()" hidings? Which one filename?

It's in the language class in /symphony/lib/toolkit/class.lang.php:
http://getsymphony.com/learn/api/2.2/toolkit/lang/#createHandle

@Nils, thanks a lot!

Ok! Here is the FIX for 2.2:

/symphony/lib/toolkit/class.lang.php:
line 609:
bug: $string = strtolower($string);
fix: $string = mb_strtolower($string);

And... Where is bugreport form at this site? Other words, how can i report this to Symphony developers team and get my medal? :)

@GydruS

Where is bugreport form at this site?

In the Issues section.

how can i report this to Symphony developers team and get my medal? :)

By the way, a similar issue was already discussed some months ago.

Where is bugreport form at this site?

On http://getsymphony.com/discuss/issues/

I believe the problem is that not all PHP installations have mb_* functions enabled...

@eKoeS, @phoque thanks!

hm... why there is no way to use something like:

function_exists('mb_strtolower') ? $string = mb_strtolower($string) : $string = strtolower($string);

or use another wrappers?

or maybe there is the reason to provide unicode and non-unicode installations of Symphony?

In my fork of Symphony I've made a set of functions dealing with such an issues. I'd really appreciate if this or something similar will be included into the core.

@andrr Interesting approach, we're more than happy to look at things like this, we were just unaware of your changes!

It would be interesting to see if this can be done more elegantly by checking on install if mb_* functions are available during installation as then the system would know immediately without having to fallback.

It'd be an interesting survey to find out just how many servers come with mb_* installed.

I encountered the exact same problem and setup, as in the original post. As it was present only on my localhost (WAMP) I was able to workaround it in php.ini level:

[mbstring]
mbstring.language = Neutral
mbstring.internal_encoding = UTF-8
mbstring.func_overload = 2

Prerequisities: enabled mbstring extension, of course.

First two lines invokes UTF-8 mode. Third line tells php to internally overload all str.. functions to their mbstring counterparts.

Not a single code rewrite is needed in symphony core.

Hope this helps someone, as those unicode issues often brings a lot of seemingly hopeless headache.

WARNING WARNING WARNING

This only (seems to) work for deployed websites, not in development stage, when creating DSes, events etc, as it affects more than only basic string operations.

Managing content and moving stuff around works fine.

EOW

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details