Click here to Skip to main content
16,011,947 members
Home / Discussions / C#
   

C#

 
QuestionConverting a unicode value (with a surrogate pair) to a character in C# Pin
vnmatt31-Dec-10 4:03
vnmatt31-Dec-10 4:03 
QuestionRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
Richard MacCutchan31-Dec-10 4:53
mveRichard MacCutchan31-Dec-10 4:53 
AnswerRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
vnmatt31-Dec-10 5:06
vnmatt31-Dec-10 5:06 
GeneralRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
Richard MacCutchan31-Dec-10 5:58
mveRichard MacCutchan31-Dec-10 5:58 
GeneralRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
jschell31-Dec-10 7:43
jschell31-Dec-10 7:43 
GeneralRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
Richard MacCutchan1-Jan-11 0:36
mveRichard MacCutchan1-Jan-11 0:36 
AnswerRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
jschell31-Dec-10 7:52
jschell31-Dec-10 7:52 
GeneralRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
vnmatt31-Dec-10 17:39
vnmatt31-Dec-10 17:39 
Thanks for the reply. I understand this well enough, but maybe everyone here is not quite understanding what I want...

Okay don't return a System.Char... give me a System.String...whatever....

I just want to do something like this:

public string GetUnicodeCharacter(string uniValue)
{
//uniValue = "U+2A601"
//Do some logic
return myUnicodeCharacter; //string that will display 𪘁
}

It seems nobody knows how to get this and it is driving me nuts. Yes I did email the author of that site (cojak.org), but no reply yet; maybe because of holidays, but I'll be lucky if he helps me anyway (not to mention his site is PHP, so might not be able to help with .NET).

Maybe there is a way to get the surrogate values from the "U+2A601" string? Then I could do something (ugly as it may be) like this:

C#
public string myImaginaryMethod()
{
   string original = "\u2A601";
   string highSurrogate = GetHighSurrogate(original); // returns "\uD869";
   string lowSurrogate = GetLowSurrogate(original); returns "\uDE01";
   return highSurrogate + lowSurrogate; //returns 𪘁
}


Surely someone must know how to get this value somehow...anyhow...I don't care how, so long as I can get 𪘁 from "U+2A601"; (or from "\u2A601" would be fine too)

Smile | :)
GeneralRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
jschell1-Jan-11 10:04
jschell1-Jan-11 10:04 
GeneralRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
vnmatt1-Jan-11 18:23
vnmatt1-Jan-11 18:23 
GeneralRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
Richard MacCutchan2-Jan-11 2:40
mveRichard MacCutchan2-Jan-11 2:40 
GeneralRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
jschell2-Jan-11 8:57
jschell2-Jan-11 8:57 
AnswerRe: Converting a unicode value (with a surrogate pair) to a character in C# Pin
Liao Jichen24-Feb-11 13:37
Liao Jichen24-Feb-11 13:37 
QuestionException Handling Pin
satsumatable31-Dec-10 1:16
satsumatable31-Dec-10 1:16 
AnswerRe: Exception Handling Pin
Hiren solanki31-Dec-10 1:28
Hiren solanki31-Dec-10 1:28 
GeneralRe: Exception Handling Pin
satsumatable31-Dec-10 1:39
satsumatable31-Dec-10 1:39 
AnswerRe: Exception Handling Pin
Hiren solanki31-Dec-10 1:43
Hiren solanki31-Dec-10 1:43 
AnswerRe: Exception Handling Pin
Rob Philpott31-Dec-10 3:22
Rob Philpott31-Dec-10 3:22 
AnswerRe: Exception Handling Pin
Pete O'Hanlon31-Dec-10 3:24
mvePete O'Hanlon31-Dec-10 3:24 
AnswerRe: Exception Handling Pin
jschell31-Dec-10 7:59
jschell31-Dec-10 7:59 
AnswerRe: Exception Handling Pin
ramit singh5-Jan-11 17:18
ramit singh5-Jan-11 17:18 
QuestionWhat free library for printing product details? - we will need tables, colors, frames Pin
haiaw31-Dec-10 0:57
haiaw31-Dec-10 0:57 
AnswerRe: What free library for printing product details? - we will need tables, colors, frames Pin
OriginalGriff31-Dec-10 0:59
mveOriginalGriff31-Dec-10 0:59 
AnswerRe: What free library for printing product details? - we will need tables, colors, frames Pin
Henry Minute31-Dec-10 12:05
Henry Minute31-Dec-10 12:05 
QuestionHow to add .h file(Header file) in c# Pin
sarang_k30-Dec-10 17:47
sarang_k30-Dec-10 17:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.