Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 329933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:38:04+00:00 2026-05-12T09:38:04+00:00

I’m currently creating a Rest client for making blog posts much in the spirit

  • 0

I’m currently creating a Rest client for making blog posts much in the spirit of pastie.el. The main objective is for me to write a textile in emacs and make a post to a Rails application that will create it. It is working fine until I type anything in either spanish or japanese, then I get a 500 error. pastie.el has this same problem also by the way.

Here is the code:

(require ‘url)

(defun create-post()

(interactive)

(let ((url-request-method "POST")

    (url-request-extra-headers '(("Content-Type" . "application/xml")))

    (url-request-data (concat "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
                              "<post>"
                              "<title>"
                              "Not working with spanish nor japanese"
                              "</title>"
                              "<content>"
                              ;; "日本語"   ;; not working
                              ;; "ñ"        ;; not working either
                              "h1. Textile title\n\n"
                              "*Textile bold*"
                              "</content>"
                              "</post>"))
    )                               ; end of let varlist
(url-retrieve "http://127.0.0.1:3000/posts.xml"
              ;; CALLBACK
              (lambda (status)
                (switch-to-buffer (current-buffer)))
              )))

The only way I can imagine right now that the problem could be fixed is by making emacs encode the utf-8 characters so that a ‘ñ’ becomes ‘&#241’ (which works by the way).

What could be a work around for this problem?

EDIT: ‘*’ is not equivalent to *’. What I meant was that if I encoded to utf-8 with emacs using for example ‘sgml-char’ it would make the whole post become utf-8 encoded. Like *Textile bold* thus making RedCloth being unable to convert it into html. Sorry, it was very bad explained.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:38:04+00:00Added an answer on May 12, 2026 at 9:38 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.