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

Quotes and validation

LEGEND ,
Nov 19, 2006 Nov 19, 2006
In articles stored in a database text fields there are German quotes,
„e.g.“. I use the alt+132 and alt+147 combinations to put them into the
text. Unfortunately, these entities do not pass the w3-validation.

Is there a way to use these quotes and pass the validation?

Thank you.

Martin
TOPICS
Server side applications
460
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 ,
Nov 20, 2006 Nov 20, 2006
Martin Lang wrote:
> Is there a way to use these quotes and pass the validation?

„Yes“

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
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 ,
Nov 20, 2006 Nov 20, 2006
.oO(Martin Lang)

>In articles stored in a database text fields there are German quotes,
>„e.g.“. I use the alt+132 and alt+147 combinations to put them into the
>text. Unfortunately, these entities do not pass the w3-validation.

What's the error message?

>Is there a way to use these quotes and pass the validation?

A proper encoding (UTF-8 for example). I use such chars all the time
without any problems.

Micha
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 ,
Nov 20, 2006 Nov 20, 2006
David Powers wrote:
> „Yes“

Yes, that works and passes, thank you!

Otherwise, if I use htmlentities, it doesn't work. And I have to use it
because of the German umlauts.
Furthermore, the user who inserts an article can "style" some words or
phrases with ... for instance. So I use regular expressions and
apply them with echo htmreplace(htmlentities(Text)). I've changed one of
the expressions to the quotes and came to:

$msg = preg_replace("/\[q\](.*?)\[\/q\]/si", "„\\1“", $msg);

That seems to work and passes. But I don't know whether that expression
is a correct one. Is it?

Martin

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 ,
Nov 20, 2006 Nov 20, 2006
.oO(Martin Lang)

>David Powers wrote:
>> „Yes“
>
>Yes, that works and passes, thank you!
>
>Otherwise, if I use htmlentities, it doesn't work. And I have to use it
>because of the German umlauts.

You don't have to use htmlentities(), just a proper encoding. Umlauts
are perfectly fine, even with ISO-8859-1. Today there's little to no
reason to use character references anymore, except for the special chars
which are handled by htmlspecialchars().

Micha
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 ,
Nov 20, 2006 Nov 20, 2006
Michael Fesser wrote:
> .oO(Martin Lang)
>
>> In articles stored in a database text fields there are German quotes,
>> „e.g.“. I use the alt+132 and alt+147 combinations to put them into the
>> text. Unfortunately, these entities do not pass the w3-validation.
>
> What's the error message?

Entities between 130 and 159 inclusive use Microsoft non-standard encoding.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
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 ,
Nov 20, 2006 Nov 20, 2006
Michael Fesser wrote:
> You don't have to use htmlentities(), just a proper encoding. Umlauts
> are perfectly fine, even with ISO-8859-1. Today there's little to no
> reason to use character references anymore, except for the special chars
> which are handled by htmlspecialchars().

Thank you for the hint!

Martin
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 ,
Nov 20, 2006 Nov 20, 2006
Michael Fesser wrote:
> What's the error message?

Error Line 91 column 198: non SGML character number 132.

You have used an illegal character in your text. HTML uses the standard
UNICODE Consortium character repertoire, and it leaves undefined (among
others) 65 character codes (0 to 31 inclusive and 127 to 159 inclusive)
that are sometimes used for typographical quote marks and similar in
proprietary character sets.

Martin
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 ,
Nov 20, 2006 Nov 20, 2006
LATEST
.oO(David Powers)

>Michael Fesser wrote:
>> .oO(Martin Lang)
>>
>>> In articles stored in a database text fields there are German quotes,
>>> „e.g.“. I use the alt+132 and alt+147 combinations to put them into the
>>> text. Unfortunately, these entities do not pass the w3-validation.
>>
>> What's the error message?
>
>Entities between 130 and 159 inclusive use Microsoft non-standard encoding.

Ah, OK. The Windows-1252 encoding ...

Micha
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