On May 30, 4:32 pm, dare ruby <mar... / angleritech.com> wrote:
> Dear all,
>
> Iam in process of building a parser. I need to convert the numeric
> character reference to corresponding ascii.
>
> when numeric character reference like &#76; or &#x00ff; is given i need
> to convert those into corresponding ascii. consider character reference
> like &#76; my parser will read character by character and eliminate &#;
> and store '76' alone in a string variable (temp), so now temp = '76', i
> need to generate its corresponding ascii value 'L'. please help me to
> the process
>
>   example: WE&#76; after ASCII code conversion it should be WELCOME as
> for 76 corresponding ascii value is 'L'.
>
>   Like wise consider the second example &#x00ff;
>
>    now temp = 00ff it should also generate its corresponding ascii code.
>
>    in both cases even if its a decimal value or hexa decimal value its
> is stored as string in my process. As iam reading character by character
> from buffer and adding each character to temp string.
>
> so please help me to solve this issue..
>
> Thanks in advance...
>
> Regards,
> Jose Martin
> --
> Posted viahttp://www.ruby-forum.com/.

'76'.to_i.chr