Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to convert a Unicode character to its ASCII equivalent
    primarykey
    data
    text
    <p>Here's the problem:</p> <p>In C# I'm getting information from a legacy ACCESS database. .NET converts the content of the database (in the case of this problem a string) to Unicode before handing the content to me.</p> <p>How do I convert this Unicode string back to it's ASCII equivalent?</p> <p><hr> <strong>Edit</strong><br> Unicode char 710 is indeed MODIFIER LETTER CIRCUMFLEX ACCENT. Here's the problem a bit more precise: </p> <pre> -> (Extended) ASCII character ê (Extended ASCII 136) was inserted in the database. -> Either Access or the reading component in .NET converted this to U+02C6 U+0065 (MODIFIER LETTER CIRCUMFLEX ACCENT + LATIN SMALL LETTER E) -> I need the (Extended) ASCII character 136 back. </pre> <p><hr> Here's what I've tried (I see now why this did not work...):</p> <pre><code>string myInput = Convert.ToString(Convert.ToChar(710)); byte[] asBytes = Encoding.ASCII.GetBytes(myInput); </code></pre> <p>But this does not result in 94 but a byte with value 63...<br> Here's a new try but it still does not work:</p> <pre><code>byte[] bytes = Encoding.ASCII.GetBytes("ê"); </code></pre> <p><hr> <strong>Soltution</strong><br> Thanks to both <a href="https://stackoverflow.com/questions/138449/how-to-convert-a-unicode-character-to-its-extended-ascii-equivalent#138579">csgero</a> and <a href="https://stackoverflow.com/questions/138449/how-to-convert-a-unicode-character-to-its-extended-ascii-equivalent#138583">bzlm</a> for pointing in the right direction I solved the problem <a href="https://stackoverflow.com/questions/138449/how-to-convert-a-unicode-character-to-its-ascii-equivalent#141816">here</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload