TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Europa Solo
NA
8
598
hexToUTF16 international letters (C# WPF)
Sep 20 2020 2:56 PM
I have created a function to convert hex to utf16. It works with english letters, but I also need it to work with international letters.
Example hexString=4A006F007200640065006E005F006D00E5006E0065007200000000000000 gives
Jorden_m
"
ner
, but I want it to give me
Jorden_m
å
ner
public
String hexToUTF16(String hexString)
{
int
length = hexString.Length;
byte[] bytes =
new
byte[length / 2];
for
(
int
i = 0; i < length; i += 2){
bytes[i / 2] = Convert.ToByte(hexString.Substring(i, 2), 16);
}
char
[] chars = Encoding.UTF8.GetChars(bytes);
string s =
new
string(chars);
s = s.Replace(
"\0"
, string.Empty);
return
s;
}
// hexToUTF16
Reply
Answers (
1
)
c# programming question
create remote directory