[FIXED] [2.5] Find a bug dealing with chinese character in Ext.net

Page 1 of 2 12 LastLast
  1. #1

    [FIXED] [2.5] Find a bug dealing with chinese character in Ext.net

    I am a student from North China Electric Power University, and recently our team is developing a Management Information System .In our project we use Ext.net to display our front page. I think Ext.net is very convenient and Greatly improved the efficiency of our development.But now we have encountered such a problem there is some Chinese character that can not be recognized. Chinese character is replaced by "??". Just like the following picture .
    Click image for larger version. 

Name:	QQ截图20131204172004.jpg 
Views:	39 
Size:	102.2 KB 
ID:	7328
    this is a front page for test ,the code is simple.The code of File "Test.aspx" is:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="CuckooUnion.Website.Test" %>
    <%@ Register TagPrefix="ext" Namespace="System.Resources" Assembly="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" %>
    <%@ Register TagPrefix="ext1" Namespace="Ext.Net" Assembly="Ext.Net, Version=2.3.1.41036, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87" %>
    <!DOCTYPE html>
    <html lang="zh">
    <head id="Head1" runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>设备安装有限公司</title>
    </head>
    <body class="top_border">
        <ext1:ResourceManager licenseKey="NTcwMjk3NjQsMiw5OTk5LTEyLTMx" runat="server" ID="MainResourceManager" InitScriptMode="Linked" ScriptMode="Debug" QuickTips="True" />
        <div class="container container_all">     
            <div>
                <style>
                    #sub_title {
                            border-top: #999999 1px solid;
                            line-height: 30px;
                            border-bottom: #999999 1px solid;
                            text-align: center;
                            width: 96%;
                            margin: 0 auto;
                            border-top: 1px solid #999;
                            border-bottom: 1px solid #999;
                        font-size: 12px;
                        font-family: 微软雅黑;
                        }
                        #title {
                            font-weight: bold;
                            font-size: 24px;
                            color: #000;
                            text-align: center;
                        }
                </style>
                <asp:Repeater runat="server" ID="RptNews">
                    <ItemTemplate>
            
                        <div style="width: 80%; margin: 0 auto; padding-top: 10px;">
                            <p style="font-family: 微软雅黑;font-size: 20px;font-weight: bold;text-align: center;">
                               <%#Eval("Title") %> 
                            </p>
                            <div class="ez-box" style="height: 20px;">
                            </div>
                            <div id="sub_title">
                                文章来源:
                                        <%#Eval("NewSource") %>
                                        作者:
                                        <%#Eval("Author") %>
                                        &nbsp;&nbsp; 发表时间:
                                        <%#Eval("AuditDate") %>
                                        &nbsp;&nbsp; 点击量:
                                        <%#Eval("Hits") %>
                            </div>
                            <div id="content" style="text-align: left;">
                                <%#Eval("Content") %>
                            </div>
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
        </div>
    </body>
    </html>
    We can find there is a "ext1:ResourceManager " in this file
    <ext1:ResourceManager licenseKey="NTcwMjk3NjQsMiw5OTk5LTEyLTMx" runat="server" ID="MainResourceManager" InitScriptMode="Linked" ScriptMode="Debug" QuickTips="True" />
    But if I remove the "ext1:ResourceManager " from this page ,then all the chinese character in the file can be displayed right.

    The code of controllor File "Test.aspx.cs" is:
    namespace CuckooUnion.Website
    {
        public class MeteDate
        {
            public string Title { get; set; }
    
            public string NewSource { get; set; }
            public string Author { get; set; }
            public string AuditDate { get; set; }
            public string Hits { get; set; }
            public string Content { get; set; }
        }
        public partial class Test : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                
                MeteDate entity=new MeteDate();
                entity.Title = "测试";
                entity.NewSource = "工会";
                entity.Author = "Gavin";
                entity.AuditDate = "2013-12-04";
                entity.Hits = "23";
                entity.Content =GetContent();
                List<MeteDate> dt=new List<MeteDate>();
                dt.Add(entity);
                RptNews.DataSource = dt;
                RptNews.DataBind();
            }
            public string GetContent()
            {
                string result = "";
                for (int i = 0; i <= 200; i++)
                {
                    result += "<p style='font-size: 16px;'>" + i + "第六十六条 国家通过各种途径,采取各种措施,发展职业培训事业,开发劳动者的职业技能,提高劳动者的素质,增强劳动者的就业能力和工作能力。" +
                               " 第六十七条 各级人民政府应当把发展职业培训纳入社会经济发展的规划,鼓励和支持有条件的企业、事业组织、社会团体和个人进行各种形式的职业培训。"+
                                "第六十八条 用人单位应当建立职业培训制度,按照国家规定提取和使用职业培训经费,根据本单位实际,有计划地对劳动者进行职业培训。"+
                               " 从事技术工种的劳动者,上岗前必须经过培训。" +
                               " 第六十九条 国家确定职业分类,对规定的职业制定职业技能标准,实行职业资格证书制度,由经过政府批准的考核鉴定机构负责对劳动者实施职业技能考核鉴定。</P>";
                }
                return result;
            }
        }
    }
    The code in Test.aspx.cs is simple, and I find that once the string contains lots of chinese character ,then there may be chinese character replaced by "??".
    I will also show the config for my project ,even I think there is not so necessary.the web.config for my project is:
    <system.web>
        <compilation debug="true" targetFramework="4.0" />
        <authentication mode="Forms">
          <forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/" />
        </authentication>
        <profile defaultProvider="DefaultProfileProvider">
          <providers>
            <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
          </providers>
        </profile>
        <membership defaultProvider="DefaultMembershipProvider">
          <providers>
            <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
          </providers>
        </membership>
        <roleManager defaultProvider="DefaultRoleProvider">
          <providers>
            <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
          </providers>
        </roleManager>
    
        <sessionState mode="InProc" customProvider="DefaultSessionProvider">
          <providers>
            <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
          </providers>
        </sessionState>
        <httpHandlers>
          <add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false" />
        </httpHandlers>
        <httpModules>
          <add name="DirectRequestModule" type="Ext.Net.DirectRequestModule, Ext.Net" />
        </httpModules>
        <pages>
          <controls>
            <add assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext" />
          </controls>
          <namespaces>
            <add namespace="Ext.Net" />
            <!--<add namespace="Ext.Net.MVC"/>-->
          </namespaces>
        </pages>
        <httpRuntime requestValidationMode="2.0" executionTimeout="3000" maxQueryStringLength="409600" maxRequestLength="40960" />
        <globalization fileEncoding="utf-8" />
      </system.web>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
          <add name="DirectRequestModule" preCondition="managedHandler" type="Ext.Net.DirectRequestModule, Ext.Net" />
        </modules>
        <validation validateIntegratedModeConfiguration="false" />
        <handlers>
          <add name="DirectRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler" />
        </handlers>
        <defaultDocument enabled="true">
          <files>
            <clear />
            <add value="default.aspx" />
          </files>
        </defaultDocument>
      </system.webServer>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
            <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
            <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
          <parameters>
            <parameter value="v11.0" />
          </parameters>
        </defaultConnectionFactory>
      </entityFramework>
      <extnet theme="Gray" />
    </configuration>
    So I wonder maybe there is some bug in Ext.net dealing with our chinese charactor.This reminds me of another interesting thing.Ok look the two java method following used to transform "InputStream" to "string".look the follow picture.
    Click image for larger version. 

Name:	QQ截图20131204173541.jpg 
Views:	19 
Size:	45.4 KB 
ID:	7329
    The left one I read inputStream by "new Byte[4096]",in this condition the result is that maybe a chinese character can be split to two character that can not recognized ,just like "??".And the right one works properly.
    So I think there maybe a bug dealing with chinese character in Ext.net. When Ext.net dealing with the stream or a long string ,Ext.net maybe split a chinese character to two parts. For example ,"社" is "c9e7" in GBK Encoding,maybe we split it to "C9"and "E7" ,and then there is "??".
    Click image for larger version. 

Name:	QQ截图20131204173549.jpg 
Views:	24 
Size:	27.7 KB 
ID:	7330
    I am confused and this makes bad influence for my project.Please help me.
    I will be very glad to receive your reply and expect you can help me solve this problem,thanks.
    My Email is lushicheng@live.cn
    Last edited by geoffrey.mcgill; Dec 18, 2013 at 4:17 AM.
  2. #2
    Hi @GavinLou,

    Welcome to the Ext.NET forums and thank you for the detailed report.

    We were able to reproduce and are investigating.

    Seems, an essential part to reproduce the issue - launching the test case IIS. It appears to be not reproducible with VS Development Server.
  3. #3
    It has been fixed in the SVN trunk and will be included to the v2.5 release.

    Thank you again for the report.
  4. #4
    yes, what do you mean by say "It appears to be not reproducible with VS Development Server."?

    Quote Originally Posted by Daniil View Post
    Hi @GavinLou,

    Welcome to the Ext.NET forums and thank you for the detailed report.

    We were able to reproduce and are investigating.

    Seems, an essential part to reproduce the issue - launching the test case IIS. It appears to be not reproducible with VS Development Server.
  5. #5
    Quote Originally Posted by GavinLou View Post
    yes, what do you mean by say "It appears to be not reproducible with VS Development Server."?
    I mean this in Project's properties.
    Click image for larger version. 

Name:	1.JPG 
Views:	25 
Size:	58.3 KB 
ID:	7332
  6. #6
    Sorry to interrupt you ,I am a new hand, can you tell me how to fix this problem in my project?
    the vesion of Ext.net used in my project is 2.1 ,need I download the Ext.net Project from the SVN trunk then compile it to bll file?And then use the compiled dll file to replace ext.net.dll or ext.net.utilities.dll or others ?
    the version of New compiled bll file is above 2.1 ,will this leads other error to my project? Or the different version is Completely compatible.
    At last , can you tell me the address of the SVN trunk,or can you send me the compiled bll file?now I am in china ,the access to foreign site is limited and
    the speed ​​is poor. my email is lushicheng@live.cn.
    Many thanks.

    Quote Originally Posted by Daniil View Post
    It has been fixed in the SVN trunk and will be included to the v2.5 release.

    Thank you again for the report.
  7. #7
    sorry,I forget to remove some not used config from web.config file,for example:
     <authentication mode="Forms">
          <forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/" />
        </authentication>
    And very glad to heared that you hava fixed this bug.Hope your product is better and better.

    Quote Originally Posted by Daniil View Post
    I mean this in Project's properties.
    Click image for larger version. 

Name:	1.JPG 
Views:	25 
Size:	58.3 KB 
ID:	7332
  8. #8
    Thank you for the kind words.

    We cannot guarantee that migration from v2.1 to the latest version will be flawless at all. But there is a good chance for that. There is a few breaking changes listed since v2.1.
    http://examples2.ext.net/#/Getting_S...AKING_CHANGES/

    Currently, the only way to get the fix is to grab the sources from the SVN trunk and build locally. The link is:
    http://svn.ext.net/premium/trunk/

    But only Premium forum members have access to the SVN.
    http://www.ext.net/store/
  9. #9
    You said that the problem will be included in v2.5 release.And Can you tell me what time v2.5 will be released?

    Quote Originally Posted by Daniil View Post
    Thank you for the kind words.

    We cannot guarantee that migration from v2.1 to the latest version will be flawless at all. But there is a good chance for that. There is a few breaking changes listed since v2.1.
    http://examples2.ext.net/#/Getting_S...AKING_CHANGES/

    Currently, the only way to get the fix is to grab the sources from the SVN trunk and build locally. The link is:
    http://svn.ext.net/premium/trunk/

    But only Premium forum members have access to the SVN.
    http://www.ext.net/store/
  10. #10
    This says "No official release date is available, although planned for 2014-Q1":
    http://www.ext.net/download/
Page 1 of 2 12 LastLast

Similar Threads

  1. how to show calendar chinese
    By qiuyuhua in forum 2.x Help
    Replies: 0
    Last Post: Sep 29, 2013, 3:55 PM
  2. Replies: 5
    Last Post: May 11, 2011, 5:31 AM
  3. Help,Desktop BUG in V1.0,From Chinese?
    By songyecc in forum 1.x Help
    Replies: 0
    Last Post: Sep 29, 2010, 8:02 AM
  4. Chinese garbled
    By mengfb in forum 1.x Help
    Replies: 0
    Last Post: Jun 05, 2009, 3:47 AM
  5. v0.5 - When can we expect roughly?
    By robsworld2006 in forum Open Discussions
    Replies: 4
    Last Post: Apr 01, 2008, 7:10 PM

Tags for this Thread

Posting Permissions