Project

General

Profile

Feature #5650

Add rb_enc_raise() to allow C extensions to raise errors with messages with correct encoding

Added by now (Nikolai Weibull) almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
[ruby-core:41160]

Description

Currently, rb_raise raises exceptions with a message with an encoding set to ASCII-8BIT. Adding rb_enc_raise() will allow the caller to raise an exception with a message with a given encoding.


Files

rb_enc_raise.patch (1023 Bytes) rb_enc_raise.patch now (Nikolai Weibull), 11/20/2011 03:33 AM

Associated revisions

Revision f45fc7da
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • error.c (rb_enc_raise): new function to raise an exception with the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 35283
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • error.c (rb_enc_raise): new function to raise an exception with the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650]

Revision 35283
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • error.c (rb_enc_raise): new function to raise an exception with the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650]

Revision 35283
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • error.c (rb_enc_raise): new function to raise an exception with the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650]

Revision 35283
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • error.c (rb_enc_raise): new function to raise an exception with the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650]

Revision 35283
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • error.c (rb_enc_raise): new function to raise an exception with the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650]

Revision 35283
Added by nobu (Nobuyoshi Nakada) over 7 years ago

  • error.c (rb_enc_raise): new function to raise an exception with the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650]

History

#1

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago

  • Tracker changed from Bug to Feature

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago

  • Status changed from Open to Feedback
  • Target version set to 2.0.0

I agree that exceptions need to consider encodings.
But I'm curious about your usage. Which needs the encoding, the format string or arguments to be converted?

Updated by now (Nikolai Weibull) almost 8 years ago

On Mon, Nov 21, 2011 at 10:14, Nobuyoshi Nakada nobu@ruby-lang.org wrote:

I agree that exceptions need to consider encodings.
But I'm curious about your usage.  Which needs the encoding, the format string or arguments to be converted?

Well, I simply think that passing the encoding to rb_enc_vsprintf as
in the patch should be fine. That, as I understand it, sets the
encoding of the format string and then any arguments will be converted
to the format strings encoding. Is that correct?

#4

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r35283.
Nikolai, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • error.c (rb_enc_raise): new function to raise an exception with the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650]

Also available in: Atom PDF