Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Problems with accent marks

Explorer ,
Feb 13, 2017 Feb 13, 2017

Take a look at this simple javascript code fragment:

   s = l.replace("à","a");

   s = l.replace("è","e");

   s = l.replace("é","e");

   s = l.replace("ì","i");

   s = l.replace("ò","o");

   s = l.replace("ù","u");

After the last update of Dreamweaver (2017.0.1) the same fagment in the browser page turns into

   s = l.replace("Ã ","a");

   s = l.replace("è","e");

   s = l.replace("é","e");

   s = l.replace("ì","i");

   s = l.replace("ò","o");

   s = l.replace("ù","u");

Where am i wrong?

I tried changing the page properties, but nothing, everything remains the same.

The only way is to save the page with notepad with ANSI encode. However if i open with dreamweaver, dreamweaver doesn't respect the new page encode and the error comes back again.

Any help?

917
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Feb 13, 2017 Feb 13, 2017

I understood!

Above the html and javascript code there is some rows with VB.NET code. If i remove VB code everything works.

Everyday there is something new.

Translate
LEGEND ,
Feb 13, 2017 Feb 13, 2017

Does this happen in a real browser when you view the source code or are you use the live preview browser in Dreamweaver when this happens?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 13, 2017 Feb 13, 2017

This happens in a real browser source code in the real application that doesn't work, of course.

"calò" does not become "calo"

because

s = l.replace("ò","o");

is

s = l.replace("ò","o");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 13, 2017 Feb 13, 2017

Have you got the documents charset meta tag set to:

<meta charset="UTF-8"/>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 13, 2017 Feb 13, 2017

Yes. I 've got it.

I tried to change, but maybe i'm not be able because it's not so clear (like ansi unicode ecc.).

Could you tell me what i have to write in "charset"?

Thank you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 13, 2017 Feb 13, 2017

'Could you tell me what i have to write in "charset"?'

If you add the below meta tag between the <head></head> tags of your document it should solve the issue:

<meta charset="UTF-8"/>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 13, 2017 Feb 13, 2017

But i've got it.

<!doctype html>

<html>

<head>

<meta charset="utf-8">

that's the problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 13, 2017 Feb 13, 2017

I'm not sure then because when I look at the browsers source code with the utf-8 meta tag I get this:

s = l.replace("à","a");

   s = l.replace("è","e");

   s = l.replace("é","e");

   s = l.replace("ì","i");

   s = l.replace("ò","o");

   s = l.replace("ù","u");

If the meta tag is not present I get this, which is what you are seeing:

   s = l.replace("Ã ","a");

   s = l.replace("è","e");

   s = l.replace("é","e");

   s = l.replace("ì","i");

   s = l.replace("ò","o");

   s = l.replace("ù","u");

Do you have an actual live page which includes your script which you can link us to?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 13, 2017 Feb 13, 2017
LATEST

I understood!

Above the html and javascript code there is some rows with VB.NET code. If i remove VB code everything works.

Everyday there is something new.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines