Skip to content

Instantly share code, notes, and snippets.

@andrerom
Created July 17, 2018 10:31
Show Gist options
  • Save andrerom/50a064e6cd39e6f2cb1d8376560063c7 to your computer and use it in GitHub Desktop.
Save andrerom/50a064e6cd39e6f2cb1d8376560063c7 to your computer and use it in GitHub Desktop.
Fix EZP-26748: Wrong image URI when content name has extended UTF characters
diff --git a/ezpublish/console b/ezpublish/console
index 6d522a9..df63c07 100644
--- a/ezpublish/console
+++ b/ezpublish/console
@@ -7,6 +7,9 @@
set_time_limit( 0 );
+// Ensure UTF-8 is used in string operations
+setlocale(LC_CTYPE, 'C.UTF-8');
+
// Use autoload over boostrap here so we don't need to keep the generated files in git
require_once __DIR__.'/autoload.php';
require_once __DIR__.'/EzPublishKernel.php';
diff --git a/web/index.php b/web/index.php
index 39061a9..142298d 100644
--- a/web/index.php
+++ b/web/index.php
@@ -4,6 +4,9 @@
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\Debug\Debug;
+// Ensure UTF-8 is used in string operations
+setlocale(LC_CTYPE, 'C.UTF-8');
+
// Environment is taken from "ENVIRONMENT" variable, if not set, defaults to "prod"
$environment = getenv( "ENVIRONMENT" );
if ( $environment === false )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment