emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Jan Böcker" <jan.boecker@jboecker.de>
To: dmg@uvic.ca
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: org-protocol: non-ASCII characters
Date: Sat, 06 Feb 2010 15:35:06 +0100	[thread overview]
Message-ID: <4B6D7E1A.3030807@jboecker.de> (raw)
In-Reply-To: <4B6D73A2.8000403@jboecker.de>

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

On 06.02.2010 14:50, Jan Böcker wrote:
> AFAIK, your current approach is correct.

I was wrong. The attached patch fixes a bug in the encode_uri function.
That fixes the non-ASCII characters problem in xournal for me.

The gchar type is just typedef'd to char, which means it is signed. To
get the byte value, it must be cast to unsigned int first.

- Jan

[-- Attachment #2: encode_uri.patch --]
[-- Type: text/plain, Size: 524 bytes --]

diff --git a/src/xo-misc.c b/src/xo-misc.c
index 6f0528c..c2582c7 100644
--- a/src/xo-misc.c
+++ b/src/xo-misc.c
@@ -2441,8 +2441,8 @@ void encode_uri(gchar *encoded_uri, gint bufsize, const gchar *uri)
       if (k + 4 >= bufsize)
         break;
       encoded_uri[k++] = '%';
-      encoded_uri[k++] = hexa[uri[i] / 16];
-      encoded_uri[k++] = hexa[uri[i] % 16];
+      encoded_uri[k++] = hexa[(unsigned char)uri[i] / 16];
+      encoded_uri[k++] = hexa[(unsigned char)uri[i] % 16];
     }
   }
   encoded_uri[k] = 0;

[-- Attachment #3: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-02-06 14:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-31  8:39 org-remember support in xournal D M German
2010-01-31  8:45 ` dmg
2010-02-03  9:19 ` Jan Böcker
2010-02-03  9:22   ` dmg
2010-02-04 18:43   ` org-protocol: non-ASCII characters D M German
2010-02-06 13:50     ` Jan Böcker
2010-02-06 14:35       ` Jan Böcker [this message]
2010-02-08 11:30         ` Sebastian Rose
2010-02-12 22:23           ` dmg
2010-02-13 13:22             ` Jan Böcker
2010-02-15  9:41               ` Sebastian Rose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B6D7E1A.3030807@jboecker.de \
    --to=jan.boecker@jboecker.de \
    --cc=dmg@uvic.ca \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).