+4  A: 

A guess: does it work if you set url-request-data to

(encode-coding-string (concat "<?xml etc...") 'utf-8)

instead?

There's nothing really to tell url what coding system you use, so I guess you have to encode your data yourself. This should also give a correct Content-length header, as that just comes from (length url-request-data), which would obviously give the wrong result for most UTF-8 strings.

legoscia
ttttttThanks!!! This is what did it. Thanks for sharing the knowledge!
wallyqs
A: 

Thanks to @legoscia I know now that I have to encode the data by myself. I'll post the function here for future reference:

(require 'url)

(defun create-post()
(interactive)
(let ((url-request-method "POST")
    (url-request-extra-headers '(("Content-Type" . "application/xml; charset=utf-8")))
    (url-request-data
     (encode-coding-string (concat "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"                                  
                                   "<post>"
                                   "<title>"
                                   "Not working with spanish nor japanese"
                                   "</title>"
                                   "<content>"
                                   "日本語\n\n"   ;; working!!!
                                   "ñ\n\n"        ;; working !!!
                                   "h1. Textile title\n\n"
                                   "*Textile bold*"
                                   "</content>"
                                   "</post>") 'utf-8)
     )
    )                               ; end of let varlist
(url-retrieve "http://127.0.0.1:3000/posts.xml"
              ;; CALLBACK
              (lambda (status)
                (switch-to-buffer (current-buffer))
                ))))                 ;let
wallyqs