AnsweredAssumed Answered

UTF-8 Encoding Issue with Umlaut in file-name

Question asked by strophi on Mar 30, 2009
Latest reply on Mar 30, 2009 by strophi
Hi Forum,

I'm working on a php presentation template to display valid / becoming invalid / invalid documents.

Everything works fine, except if there's a file with an german umlaut in the filename. This occurs only with php, cifs and anything else is working correctly.


Here


$model = $_ALF_MODEL;

$thisSpace = $model['space'];

$arrValid = array();
$arrInvalidWithin30Days = array();
$arrInvalid = array();   

foreach ($thisSpace->files as $id => $node)
{
   echo "<p>id: $id<br />";   

   echo 'Title: '.$node->cm_name."<br />";  // <— This is the line that raises the error, if $node->cm_name contains an german umlaut
   echo 'From: '.$node->cm_from."<br />";
   echo 'To: '.$node->cm_to."<br />";
.
.
.

   

And this this the error log:

16:59:07,217 ERROR [org.alfresco.web.ui.common.Utils] Error executing script.
org.alfresco.service.cmr.repository.TemplateException: Error executing script.
   at org.alfresco.repo.processor.TemplateServiceImpl.processTemplate(TemplateServiceImpl.java:189)
   at org.alfresco.repo.processor.TemplateServiceImpl.processTemplate(TemplateServiceImpl.java:111)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy187.processTemplate(Unknown Source)
   at org.alfresco.web.ui.repo.component.template.UITemplate.encodeBegin(UITemplate.java:159)
   at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:467)
   at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:320)
   at org.apache.jsp.jsp.browse.browse_jsp._jspx_meth_r_005ftemplate_005f0(browse_jsp.java:2355)
   at org.apache.jsp.jsp.browse.browse_jsp._jspx_meth_a_005fpanel_005f3(browse_jsp.java:2301)
   at org.apache.jsp.jsp.browse.browse_jsp._jspService(browse_jsp.java:833)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
   at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
   at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
   at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
   at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:619)
Caused by: org.alfresco.scripts.ScriptException: Error executing script.
   at org.alfresco.module.phpIntegration.PHPProcessor.executeScript(PHPProcessor.java:227)
   at org.alfresco.module.phpIntegration.PHPProcessor.process(PHPProcessor.java:380)
   at org.alfresco.repo.processor.TemplateServiceImpl.processTemplate(TemplateServiceImpl.java:181)
   … 57 more
Caused by: java.io.CharConversionException: illegal utf8 encoding
   at com.caucho.vfs.StringWriter.write(StringWriter.java:131)
   at com.caucho.vfs.WriteStream.flush(WriteStream.java:348)
   at org.alfresco.module.phpIntegration.PHPProcessor.executeScript(PHPProcessor.java:213)
   … 59 more

any help or hints are appreciated and thanks in advance

strophi

Outcomes