gohugoioTheme: German umlauts not working in /docs navigation

Hi,

using German umlauts in name variables is not working, e.g.:

[[menu.docs]]
  name = "Über Hugo"
  weight = 1
  identifier = "about"
  url = "/about/"

I tried de and utf-8 for language code:

defaultContentLanguage = "de"
languageCode = "de-de"

Any ideas how to fix this?

Ciao!

Hi,

what encoding are using in your config file? You have to use UTF-8 (without BOM) in order to get the correct umlauts.

If this is OK, you should check the template. In order to display UTF-8 correctly in the browser the generated HTML files must contain <meta charset=utf-8>

Hi,

I checked utf-8, but no success. This is the config:

$ file -i config.toml
config.toml: text/plain; charset=utf-8

config.toml

defaultContentLanguage = "UTF-8"
languageCode = "UTF-8"

generated site header:

<!DOCTYPE html>
<html class="no-js" lang="UTF-8">
  <head>
    <meta charset="utf-8">

Tested with 0.29 running hugo server -D, browser Firefox and Chrome.

Ciao!

I have checked my config.toml:
defaultContentLanguage defines a language and not the encoding. In my file its simply “de”. And languageCode is the full language code, which is “de-De”. It was not necessary to set any option for the correct encoding.

How do the Umlauts appear in the HTML page? On my page a menu item with umlaut is generated like this:
<a href="/de/ueber-mich">Über mich</a>

But I need to test it tomorrow with the latest Hugo version. I am running Hugo 0.25.

In a HTML page, like in a news page, a link like <a href="/de/ueber-mich">Über mich</a> is working fine, but’s that’s in the text not in a menu.

The navigation item - where the “fly out” submenu is not workling - in the docs area looks like this:

<ul class="list dib ph0 ma0 scrolling-touch tc">  
    <li  class="tl dib ma0 hover-bg-black w-100">
        <a href="/about/" class="ttu f6 link primary-color-light  hover-white db brand-font mb1  ma0 w-100 pv2 ph4">
          Über Hugo
        </a>
    </li>

Removing the Ü makes it working. hmmm …

ctrl+i in firefox says:

SyntaxError: '.%C3%BCber' is not a valid selector  app.bundle.js:1
	r http://localhost:1313/dist/app.bundle.js:1:3082

I just cloned a fresh hugoDocs repo and get the same error. Hugo is 0.29, 64bit Debian.

Ciao!

This seems to be a problem of the Javascript. I have never seen before that the content of a tag is used as a selector. The message is also quite interersting. %C3%BC is a lower-case “ü”. So it seems that some JavaScript converts the selector value to lower-case.
You could try to use an HTML Entity definition instead of the Ü. This would be &Uuml; for an upper-case Ü

Hi,

I tried &Uuml; before posting here, sorry I didn’t mention. It’s not displayed as HTML, but as &Uuml;. :frowning:

Ciao!
M