Why does a character trail after the hyperlink tag by one space when coded in a specific way? - html

The character used in this question examples is the period, it appears that all characters behave the same way. Why does the period trail after the hyperlink by one space character when coded like this:
You can become one of us
<a href="http://www.somedomain.com/oneOfUs/allYourBaseAreBelongToUs/">
here
</a>
.
I checked the ascii character array for the above and it looks to be a simple space:
104 101 114 101 32 46
vs no trailing space after the hyperlink when coded like this:
You can become one of us
here.
The ascii character array for the above contains no space in output, but providing the character array for output comparison: 104 101 114 101 46

This is because the newline in the first example is converted to a space. There is a more thorough explanation in this thread: Prevent browser converting '\n' between lines into space (for Chinese characters)

Related

Mysql - Select all rows with special characters (but ignore space)

I'm trying to write a query to identify what rows have special characters in them, but I want it to ignore spaces
So far I've got
SELECT word FROM `games_hangman_words` WHERE word REGEXP '[^[:alnum:]]'
Currently this matches those that use all special characters, what I want is to ignore if the special character is space
So if I have these rows
Alice
4 Kings
Another Story
Ene-tan
Go-Busters Logo
Lea's Request
I want it to match
Ene-tan, Go-Busters Logo and Lea's Request
Simply extend your class.
... WHERE word REGEXP '[^[:alnum:] ]' ...
for only a "regular" space (ASCII 32) or
... WHERE word REGEXP '[^[:alnum:][:space:]]' ...
for all kind of white space characters.

How do I hyperlink a phone number?

I am trying to hyperlink a number (international phone number) on my HTML webpage.
I've looked at tons of other examples online, and mine looks exactly the same so I'm not sure why it's not working :(
+44 20 7123 4567
and here is my error message
enter image description here
HREF links can’t contain spaces.
So your code will look like:
+44 20 7123 4567
Hyperlinks (the URI in href="") cannot contain spaces. Fortunately E.123 and E.164 (the international phone number standards) do not require spaces or formatting characters either.
You have two options:
Use URI-encoded spaces %20:
+44 20 7123 4567
Remove spaces:
+44 20 7123 4567
I prefer #2 because it makes it easier to see the real digits because %20 contains digits.
Remove the space between the numbers in your html. For example: +44 20 7123 4567.

Unicode binded Special Auxiliaries character output error in report

I inserted a string into a mysql utf-8 database as අධ්‍යාපන. But the output in the Report displays as : අධ් ්‍ය පන.
This happens to other binding characters too. What solution can I use to fix this?
(I don't have an "answer", but further info. Maybe you or someone else can take it from here. I know nothing about Sinhala.)
Hex for the first should be
E0B685 E0B6B0 E0B78A E2808D E0B6BA E0B78F E0B6B4 E0B6B1
is that what a SELECT HEX(...) shows? The other is
E0B685 E0B6B0 E0B78A 20 E0B78A E2808D E0B6BA 20 E0B6B4 E0B6B1
Notice the spaces (20) in it. I wonder what added the spaces.
Can you explain these two characters? One was duplicated, the other was removed??
UTF=8 Unicode Meaning
E0B78A 3530=x0DCA [්] NSM SINHALA SIGN AL-LAKUNA
E0B78F 3535=x0DCF [ා] L SINHALA VOWEL SIGN AELA-PILLA

HTML regex space

I'm trying to bind a regex to my HTML form for an EU bank account. So far, I was able to piece together that:
pattern="[A-Z]{2}[000000000-999999999]{9}
Will let something pass that's for example UK123456789
But I also want to let it pass for UK12 2345 6789
How do I go about accepting a space at exactly those placements?
pattern="[A-Z]{2}[000000000-999999999]{9}"
This only accidentally does what you want. ([000000000-999999999] says "this character should be a 0 or a 0 or a 0 or ... a character in the range of 0-9 or a 9 or a 9 or ... a 9.) The proper form is:
pattern="[A-Z]{2}[0-9]{9}"
or more accurately:
pattern="[A-Z]{2}\d{9}"
Now that we have something more rational, we can extend that to:
pattern="[A-Z]{2}\d{2}\s?\d{4}\s?\d{4}"
which allows optional whitespace at the specific locations.
If you want to allow just spaces rather than any whitespace character, you could do:
pattern="[A-Z]{2}\d{2} ?\d{4} ?\d{4}"
You can allow an optional whitespace using \s?, though it'l make your regex a little longer. Below regex will allow both with or without whitespace (DEMO)
\w{2}\d{2}\s?\d{4}\s?\d{4}
But be aware that an european IBAN is longer than what you have posted - though I'm not sure how it is in the UK.
If you don't care where the spaces are, as long as there are 9 digits, you can remove all the spaces before checking:
str = 'UK12 234 56789';
strToCheck = str.replace(/ /g, '');
validStr = strToCheck.match(/[a-zA-Z]{2}\d{9}/);
if (validStr) {
console.log('Valid');
}

What is the difference between   and  ?

I have written one XSLT to transform xml to html. If input xml node contains only space then it inserts the space using following code.
<xsl:text> </xsl:text>
There is another numeric character which also does same thing as shown below.
<xsl:text> </xsl:text>
Is there any difference between these characters? Are there any examples where one of these will work and other will not?
Which one is recommended to add space?
Thanks,
Sambhaji
  is a non-breaking space ( ).
  is just the same, but in hexadecimal (in HTML entities, the x character shows that a hexadecimal number is coming). There is basically no difference, A0 and 160 are the same numbers in a different base.
You should decide whether you really need a non-breaking space, or a simple space would suffice.
It's the same. It's a numeric character reference.
A0 is the same number as 160. The first is in base 16 (hexadecimal) and the second is in base 10 (decimal, everyday base).