Questions tagged [canonicalization]

is a process for converting data that has more than one possible representation into a "standard", "normal", or canonical form.

As per Wikipedia:

In computer science, canonicalization (abbreviated c14n, where 14 represents the number of letters between the C and the N; also sometimes standardization or normalization) is a process for converting data that has more than one possible representation into a "standard", "normal", or canonical form. This can be done to compare different representations for equivalence, to count the number of distinct data structures, to improve the efficiency of various algorithms by eliminating repeated calculations, or to make it possible to impose a meaningful sorting order.

197 questions
1
vote
2 answers

Which is the proper XML exclusive canonicalization?

I'm using xmlseclibs to try and sign a SOAP document, but it does not seem to canonicalize things in the same way depending on whether I'm signing or validating. I'll give you an example. This is the XML I am trying to sign:
soapergem
  • 9,263
  • 18
  • 96
  • 152
1
vote
0 answers

PHP: XML C14n for SEPA container file hash

Similarly to this question, I'm trying to calculate a document hash value for a SEPA container file. This is the container my code currently generates:
Tim Okrongli
  • 169
  • 2
  • 8
1
vote
1 answer

Does DKIM header canonicalization insert a space after each comma in the To: header?

Using Zend Framework 1.12, PHP 5.3.1. Specifying multiple mail recipients to Zend_Mail and using Smtp transport, the "To:" header contains a list of recipients separated by commas. E.g. To: a@example.com,b@example.com This appears to be correct…
sootsnoot
  • 2,178
  • 3
  • 22
  • 27
1
vote
1 answer

Locale - how to get case-sensitive value?

I have code like this: import java.util.Locale; Locale locale = new Locale("en_US"); When I wrote: System.out.println(locale.toString()); it returns en_us not en_US is any way to get case-sensitive value?
David Silva
  • 1,939
  • 7
  • 28
  • 60
1
vote
1 answer

Missing CR at end of the line in org.apache.xerces.jaxp.DocumentBuilderImpl

i'm using org.apache.xerces.jaxp.DocumentBuilderImpl for loading xml documents in java. Document to load is: CRLF CRLF CRLF I load document in common way: DocumentBuilder builderXml =…
eldrex
  • 143
  • 9
1
vote
2 answers

wordpress url parsing using php - parse into php variable

hello wordpress/ url/ php experts I really appreciate your help in advance. I set up a wordpress website and the url for example www.domain.com/hello-world-how-are-you so what i want to do is within single.php script, i want to parse the url and…
msjsam
  • 183
  • 2
  • 4
  • 10
1
vote
3 answers

URL Canonicalization (.htaccess)

I would like to use my .htaccess file to add "www." to all URL's if there requested without it but my hopes are that I can do this without having to define the domain as I would like to use this code on many sites without having to edit it. Is this…
1
vote
1 answer

verifying a WCF signed SOAP message

I have a problem verifying a SOAP message timestamp and body. Before starting to write any code I'm trying to verify it by myself, these are the steps I followed to verify the timestamp: 1) Extract the timestamp tag, add any used namespace and write…
TehJabbit
  • 239
  • 1
  • 2
  • 8
1
vote
1 answer

htaccess redirect subdomain to folder and non-www to www

sub.domain.com redirect to www.domain.com/sub redirects using: RewriteEngine on RewriteCond %{HTTP_HOST} ^sub.domain.com$ RewriteRule ^(.*)$ "http://www.domain.com/sub/$1" [R=301,L] domain.com/sub to www.domain.com/sub is where I'm stuck.The…
Blair
  • 13
  • 3
1
vote
2 answers

Rewrite URI when a certain file (no matter under which URI) is served?

Is it possible in .htaccess to redirect/rewrite (301) to a certain URI when a certain "physical" (static) file is served? It shouldn’t matter under which URI this file is served initially. Example In the document root of example.com there is a file…
unor
  • 92,415
  • 26
  • 211
  • 360
1
vote
1 answer

Canonical Redirect with classic ASP shows site folder

If pointed to http://domain.com it redirects to http://www.domain.com/thesite/index.asp which is the actual location. No matter the page, it always appends the actual folder path. ive been using this script for canonical redirection, included in…
legion1978
  • 43
  • 7
1
vote
1 answer

Site Performance: rel=canonical vs redirect 301

From this page on the blog of Matt Cutts, he says that rel=canonical should be a secondary choice if you can't use a 301 redirect. Is there any performance issue with using a 301 redirect instead of a rel=canonical?
roybalderama
  • 1,650
  • 21
  • 38
1
vote
2 answers

PHP DOMNode::C14N() omits root element's second namespcae

I am trying to validate an XML message that is signed using XMLDSig. In order to create a message digest, I need to canonicalize the message first. It works fine, except that DOMNode::C14N() removes the second namespace from the code below:
Xano
  • 62
  • 5
1
vote
1 answer

Android XML Canonicalization

I'm trying to canonicalize some xml I receive from a server on an android device. However, Android does not seem to like org.apache.xml.security.c14n.Canonicalizer.canonicalize(String inputText). This is because Android's DOM library does not like…
Jainathan Leung
  • 1,147
  • 2
  • 15
  • 27
0
votes
2 answers

Normalizing a field using a single UPDATE in MySQL

Is there any way to perform an update for normalizing a field using a single query? Example: UPDATE person SET name = REPLACE(name, 'á', 'a'); UPDATE person SET name = REPLACE(name, 'é', 'e'); UPDATE person SET name = REPLACE(name, 'í', 'i'); UPDATE…
rfc1484
  • 9,441
  • 16
  • 72
  • 123