Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong encoding of content in partial widget pages #2 #12

Closed
rkeitel opened this issue Jun 16, 2020 · 7 comments
Closed

Wrong encoding of content in partial widget pages #2 #12

rkeitel opened this issue Jun 16, 2020 · 7 comments

Comments

@rkeitel
Copy link
Contributor

rkeitel commented Jun 16, 2020

Characters - like ä, ö, ü, ß in German - are displayed as "ö" or something else. If I show the same content in a normal widget, which is not added to a partial widget page, the characters are correctly encoded.

I have a container in the root with employees. On the home page I have a hierarchy of partial widget pages:
image

The deepest partial widget page "Employee Highlight (Anja)" has a link (NodeGUID) to the selected employee to show the content. The name is displayed correctly:
image

On "Top One-Column B" there are a partial page widget (top) and a default widget (bottom). On the default widget, the name is displayed correctly, but not on the partial page widget:
image
image

On the home page, where "Top One-Column B" is added as partial page widget, the name is displayed incorrectly, for both!
Top one (partial page widget) from the partial widget page:
image
Bottom one (default widget) from the partial widget page:
image

The deeper the hierarchy of partial widget pages is the often the encoding is wrong.

@KenticoDevTrev
Copy link
Owner

I was unable to replicate, when i added your special characters it properly displayed the right characters on the partial widget page. There may be more going on with this though. It's not hard to tweak the encoding settings, but it's hard for me to know what to tweak it to. Perhaps you can fork your branch and see what needs to be done that fixes it in your case?

@rkeitel
Copy link
Contributor Author

rkeitel commented Jun 16, 2020

Did you try it with my approach (container with content only pages) or with a text editor?

@KenticoDevTrev
Copy link
Owner

KenticoDevTrev commented Jun 16, 2020 via email

@rkeitel
Copy link
Contributor Author

rkeitel commented Jun 17, 2020

What happens if you add a static text with umlauts to the page whereon you add the widget? This is my case.

@KenticoDevTrev
Copy link
Owner

KenticoDevTrev commented Jun 17, 2020 via email

@rkeitel
Copy link
Contributor Author

rkeitel commented Jun 17, 2020

<section class="employee-content">
  <div class="jumbotron">
    @if (Model.Employee == null)
    {
      <p>@Html.LocalizeExt("Staff.Employee.LinkInfo")</p>
    }
    else if (!Model.Employee.HasValues)
    {
      <p>@Html.LocalizeExt("Staff.Employee.DataInfo")</p>
    }
    else
    {
      <div class="row">
        @if (!string.IsNullOrEmpty(Model.Employee.ImagePath))
        {
          <div class="col-auto">
            <img alt="@Model.Employee.FirstName @Model.Employee.LastName" src="@Url.ImageUrlExt(Model.Employee.ImagePath, new MaxWidthOrHeightSizeConstraint(122))">
          </div>
        }
        <div class="col">
          <h1>@Model.Employee.FirstName @Model.Employee.LastName äöüß</h1>
        </div>
      </div>
    }
  </div>
</section>

@KenticoDevTrev
Copy link
Owner

Thanks, having it hard coded in there allowed me to replicate. I adjusted the Encoding to UTF8, that fixed the issue, the AJAX loading one did not show this issue, only the server side. I updated both my nuget package and the custom one i made for you, however going forward i probably won't be updating your package so you'll need to generate your own packages going forward, but hopefully no more issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants