[ 
https://issues.apache.org/jira/browse/OFBIZ-6739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013625#comment-15013625
 ] 

Jacques Le Roux commented on OFBIZ-6739:
----------------------------------------

Actually there is a CategoryContentWrapper constructor which allows to pass 
your own mime type. Could you be more explicit about the change you made, 
because there are no CategoryContentWrapper services in the OFBiz sense of 
service. I guess you did at least that:
{code}
Index: 
applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java
===================================================================
--- 
applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java 
    (revision 1714681)
+++ 
applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java 
    (working copy)
@@ -76,7 +76,7 @@
         this.dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
         this.productCategory = productCategory;
         this.locale = UtilHttp.getLocale(request);
-        this.mimeTypeId = "text/html";
+        this.mimeTypeId = "text/html; charset=utf-8";
     }

     public StringUtil.StringWrapper get(String prodCatContentTypeId, String 
encoderType) {
{code}

And maybe even this?
{code}
Index: 
applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java
===================================================================
--- 
applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java 
    (revision 1714681)
+++ 
applications/product/src/org/ofbiz/product/category/CategoryContentWrapper.java 
    (working copy)
     public StringUtil.StringWrapper get(String prodCatContentTypeId, String 
encoderType) {
@@ -85,7 +85,7 @@

     public static String getProductCategoryContentAsText(GenericValue 
productCategory, String prodCatContentTypeId, HttpServletRequest request, 
String encoderType) {
         LocalDispatcher dispatcher = (LocalDispatcher) 
request.getAttribute("dispatcher");
-        return getProductCategoryContentAsText(productCategory, 
prodCatContentTypeId, UtilHttp.getLocale(request), "text/html", 
productCategory.getDelegator(), dispatcher, encoderType);
+        return getProductCategoryContentAsText(productCategory, 
prodCatContentTypeId, UtilHttp.getLocale(request), "text/html; charset=utf-8", 
productCategory.getDelegator(), dispatcher, encoderType);
     }

     public static String getProductCategoryContentAsText(GenericValue 
productCategory, String prodCatContentTypeId, Locale locale, LocalDispatcher 
dispatcher, String encoderType) {
@@ -136,7 +136,7 @@
         }

         if (UtilValidate.isEmpty(mimeTypeId)) {
-            mimeTypeId = "text/html";
+            mimeTypeId = "text/html; charset=utf-8";
         }

         if (delegator == null) {
{code}

It would be OK with me, but we might consider other opinions. Also this 
concerns not only the CategoryContentWrapper but all the 7 *ContentWrappers.

I find your English not so bad, but I'm French so ;)

> Can not display product category name in Unicode.
> -------------------------------------------------
>
>                 Key: OFBIZ-6739
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6739
>             Project: OFBiz
>          Issue Type: Bug
>          Components: product
>    Affects Versions: Trunk
>            Reporter: Thanakrit Wongyued
>            Assignee: Jacques Le Roux
>
> Hi, All
> I found problem to display product category name in Unicode (Thai UTF-8) . 
> The problem is services in CategoryContentWrapper are create content mimeType 
> in "text/html". Then i try to fixed this problem by replace "text/html" with 
> "text/html; charset=utf-8". After that i recompile and restart OFBiz the 
> problem is disappear.
> Sorry for my English.
> Best Regard,
> Thanakrit



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to