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

Problems with german umlauts in filename #13

Open
olili opened this issue Feb 25, 2021 · 1 comment
Open

Problems with german umlauts in filename #13

olili opened this issue Feb 25, 2021 · 1 comment

Comments

@olili
Copy link

olili commented Feb 25, 2021

I have problems with media files witch have German umlauts like äüöÄÜÖß inside.
These files were displayed at the clients as character garbage. Anything else seems to work as expected.

I already added attached escaping function to soap.cpp. The umlauts are now shown correctly at the client, but a dot "." is inserted in front of any umlaut like ".ä" or ".Ü" .
Do you have any idea where the dots come from or what to modify in addition?

changes in soap.cpp:
` inline void add_esc_char(int ch,std::string& s)
{
switch(ch)
{
case '<': s.append("<",4); break;
case '>': s.append(">",4); break;
case '&': s.append("&",5); break;
case '"': s.append(""",6); break;
case ''': s.append("'",6); break;
case 0x84: s.append("Ä",6); break;
case 0x96: s.append("Ö",6); break;
case 0x9c: s.append("Ü",6); break;
case 0xa4: s.append("ä",6); break;
case 0xb6: s.append("ö",6); break;
case 0xbc: s.append("ü",6); break;
case 0x9f: s.append("ß",6); break;
default: s+=ch; break;
}
}

std::string esc(const std::string& s)
{
    std::string dst;

    for(const unsigned char* p=(unsigned char*)s.c_str();*p;p++)
      {  if (*p != 0xc3 ) { add_esc_char(*p,dst);} }

    return dst;
}

`

@olili
Copy link
Author

olili commented Feb 27, 2021

identified the issue by my self.
Escaping is not necessary for UTF-8 coded umlauts. Therefore forget my proposed changes in soap.cpp.

Problem is in charset.cpp translation table. Simply change the entry for "c3" from dot "2e" to "c3".
That's it!

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

1 participant