Click here to Skip to main content
15,891,423 members
Everything / Unicode

Unicode

Unicode

Great Reads

by Doc Lobster
String conversion using the C++ Standard Library only
by Amit Singh Baghel
A useful tip to export a Div to PDF (with Unicode support) with the help of NReco-PDF Generator for .NET (C#), JQuery and Handler in ASP.NET
by Gregory Morse
Rendering Qur'anic (complex Arabic) scripts with Unicode in a PDF
by Michael Haephrati
A Static Library which can be used for all kinds of database related needs

Latest Articles

by Member 15078716
Unicode / Creating, Writing, Appending / a text (*.txt) file - how to do it
by Michael Haephrati
A Static Library which can be used for all kinds of database related needs
by DebugST
Use [Unicode 14.0.0] version. Can support automatic code generation according to the latest version.
by honey the codewitch
Add UTF-32 support and easy foreach streaming to your apps

All Articles

Sort by Title

Unicode 

19 Apr 2013 by iDebD
Hi, I am trying to show a message box item as "اردو ویکیپیڈیا", this is a unicode character; I am using Delphi 7; but in the editor it is showing as ????? ?????, it is not supporting unicode;Can any one tell me what I need to do in the Delphi editor or project to make it unicode...
19 Apr 2013 by Eugene Mayeski
In your case the simplest would be to create UTF8 representation of your string, write ConvertUTF8ToUTF16 function or find an existing one and then call MessageBoxW(0, ConvertUTF8ToUTF16('yourUTF8Constant'), ... ). This way you can deal with any Unicode text in non-Unicode Delphi.Edit: seems...
19 Apr 2013 by Sergey Alexandrovich Kryukov
I'll tell you the sad story, but some solutions do exist.Unfortunately, this version of Delphi had limited support of Unicode. Borland VCL was not Unicode-enabled at all, so, with the controls you are using, you cannot do anything at all. You would need some custom controls replacing VCL....
14 Jan 2014 by ilostmyid2
hiin the following code:FILE *fp=fopen("f5.txt", "wt");LPCWSTR uctext=L"سلام";int stat=fputws(uctext,fp);fclose(fp);i get an empty file with stat=-1. why?! i expect fputws convert the unicode text which is in arabic language to multibyte string and write it to file.any idea?thx
17 Jan 2014 by Richard MacCutchan
I tested your code and received the error EILSEQ (42), which indicates that a character was found in the string that cannot be converted.[edit]Feedback from OP suggests that the WideCharToMultiByte function has been used to resolve the problem.[/edit]
16 Dec 2011 by Pascal Ganaye
A custom C# string implementation that stores its data in a UTF8 byte array.
25 Jul 2014 by JamesHurst
Walks through the creation of an on-screen virtual keyboard for entering non-ASCII chars
20 Feb 2014 by songtzu
the data in access db is this:download demo code:http://files.cnblogs.com/songtzu/ADO.rar[^]m_Conn.SetConnectionString("Provider=Microsoft.Jet.OLEDB.4.0; Data Source= TestDb.mdb;Jet OLEDB:DataBase...
25 Feb 2014 by Maciej Los
Have a look here: How to Query a Unicode SQL table column from Access 2010[^]. It might help.
25 Jan 2017 by 잔리나
Hey please help me! When I add data as in Khmer Unicode to column in SQL Server 2012 through TextBox in C#, it shows ??? but when I type Khmer Unicode direct in SQL Server Column it shows Khmer Language. So can anyone help me please to input data as Khmer Unicode through TextBox in C# and show...
25 Jan 2017 by #realJSOP
Make sure your parameter and field types match (and they should be NVARCHAR).
14 Oct 2015 by Ahsan Mughal
Hello. I need to print arabic character using C++, the prob is i dont know how to, please guide me step by step, how i write that program, how to use unicode. Please help me iam beginner.
14 Oct 2015 by Richard MacCutchan
Writing non-Western characters is much the same as writing western ones. You can do it with wcout or wprintf, something like: wstring message = L"السلام عليك"; cout
28 Mar 2011 by jean Davy
std::string source = "Hello World";std::wstring result( source.begin(), source.end() );One coding line less !
13 May 2011 by blytle
also since _bstr_t's have operator (char *) and operator (wchar_t *) if you have included comutil.h, you can use it to do your conversion.char * source = "this is my source" ;_bstr_t converter_temp(source) ;wstring target ;target = wstring(converter_temp) ;... and the other way...
14 May 2011 by Philippe Mori
inline std::wstring AsciiToUnicode(std::string text){ // Could do some DEBUG check here to ensure it is really ASCII. // Also, if in the future, it is found, it is not the case, // it would much easier to update code. // Same as jean Davy here... return...
25 Sep 2013 by Rohit16db
I am using bcp command in sql server to export data generated from a query to .csv file with the help of following commandxp_cmdshell bcp "select * from table1" QUERYOUT /c /t, -T -S It is working fine and exporting data as expected but now we have a column which contain multilingual...
25 Sep 2013 by Maciej Los
Please, read the comment of RedDK and follow the link provided by Him:RedDK wrote:Possibly the -C option needs to be set. Specific codepage can be input, if its not ACP, OEM, or RAW. Isn't there a way to say it in TSQL also, using same keywords, somewhere in the " " string?See...
24 Aug 2011 by nazrul mondal
can any one tell me how can i show the Bengali letter in my property file because whenever i copy the Bengali letter and try to past in file it give an error (Actually not an error it show like @##### that.).So is there any jar file or any other things which i have to add in my project ,...
25 Aug 2011 by Nagy Vilmos
Make sure you have a font that supports Bengali characters for viewing your resource file. It is probably correct underneath, but just fails to render in correctly. Check in Tools > Options > Fonts & Colors.
11 Mar 2015 by Member 11500796
struct add_1000 { add_1000(unsigned& r_) : r(r_) {} void operator()(wchar_t) const { r += 1000; } unsigned& r; }; struct add_roman { add_roman(unsigned& r_) : r(r_) {} void operator()(unsigned n) const { r += n; } unsigned&...
17 Nov 2014 by Ashokkuma
Hi,I am inserting European language text into nvarchar column in SQL server 2008. The accented characters are not stored properly in the SQL DB.string strData = "Accented chars- Les caractères accentués français ";DataTable dtTemp = new DataTable( );dtTemp.Columns.Add( "ID", typeof(...
17 Nov 2014 by OriginalGriff
As well as the sendStringParametersAsUnicode parameter Peter mentioned, also check your table definition: if it is VARCHAR then that may be the problem. Try NVARCHAR instead, as it supports Unicode.
17 Nov 2014 by Ashokkuma
thanks for your replies. The issue seems to occur while reading the csv file into data table before bulk insert. I included the encoding parameter while reading the csv file. (Encoding.Default) and it loads the french text properly and it gets stored in SQL DB without any issues.old code:...
17 Nov 2017 by ali_1
I need to insert a text file with unicode characters . Its not inserting completely !. My file having aroud 7 lakhs unicode characters. I need to insert it through SQL without using any programming technilogies. I need to insert it through SQL query Can anyone suggest a solution ? I am using...
17 Nov 2017 by RedDk
Try: BULK INSERT Filecontent FROM 'myfilepath' WITH (DATAFILETYPE='widechar', FIELDTERMINATOR='none' );
21 Nov 2017 by ali_1
Hi All, Inertion failed to while passing a large string to SQL query String as follows: %PDF-1.6 %���� 69 0 obj > endobj 75 0 obj >/Filter/FlateDecode/ID its having around 7 lakhs...
21 Nov 2017 by Patrice T
SqlCommand cmd = new SqlCommand("insert into FileContent values(" + readText + ")", con); Not a solution to your question, but another problem you have. Never build an SQL query by concatenating strings. Sooner or later, you will do it with user inputs, and this opens door to a vulnerability...
21 Nov 2017 by Richard Deeming
Simple: string readText = File.ReadAllText(@"D:\olefy001.txt"); using (SqlCommand cmd = new SqlCommand("insert into FileContent values (@ReadText)", con)) { cmd.Parameters.AddWithValue("@ReadText", readText); cmd.ExecuteNonQuery(); } Everything you wanted to know about SQL injection...
22 Apr 2015 by Kyudos
I have this working in my 32 bit unicode build:// Open and delete the Log FileLogFile.open(m_LogFilePath, std::ofstream::out | std::ofstream::binary);// Check for a file open failureif (LogFile.fail() != 0){ Prompt.LoadString(IDE_FILE_OPEN_ERR); AfxMessageBox((Prompt + "\n") +...
22 Apr 2015 by Richard MacCutchan
Yes, see https://msdn.microsoft.com/en-us/library/f1d6b0fk.aspx[^].
15 May 2011 by Ángel Manuel García Carmona
I want to know how can i change an string encoding.Thanks in advanceRegards
10 May 2011 by Keith Barrow
Essentially the process it to convert the original string into an array of bytes and the convert the array of bytes back into a string using the encoding you want. To do this you use the Encoding class, there is an example of what you are doing here[^] (near the bottom), except that it is taking...
10 May 2011 by Orcun Iyigun
As Oshtri said this[^] is the class you need to look at. Referance pages;UTF16 to UTF8 to UTF16 simple CString based conversion[^]Convert UTF8 and ASCII encoded bytes back to UTF 16 encodedstring[^]
3 Jun 2012 by Jawahar Suresh Babu
Character Map is a free utility found in Windows Machines. It is similar to the "Insert Symbol" tool in few MS Office applications. This article explains how to implement this tool using WPF.
4 Apr 2011 by Member 3344783
I am using ADO .net to write a string to a field in a table of Microsoft SQL Server 2005 database.I am using SqlBulkCopy::WriteToServer api to write to SQL database.The data type of the column in Sql database table is of type varchar2. If I change the datatype to nvarchar the chinese...
4 Apr 2011 by Prerak Patel
No, nvarchar supports Unicode, while varchar doesn't.You have to use nvarchar only for chinese character support.
1 Jun 2013 by Sergey Alexandrovich Kryukov
Yes, setting up a proper font, in particular, Arial Unicode MS, should solve the problem. I have no idea why you failed to do that, as you did not explain how you tried. This is really simple thing.To check up what character repertoire is supported by what form, use the application which is...
1 Jun 2013 by KirkL2
Hello,I'm struggling a bit trying to display Chinese characters in my VB.Net app.I'm using TextBoxes and DataGrids. I'm pasting Chinese glyphs over from Excel into the TextBox controls. All the Chinese glyphs show properly in Excel. When pasted into the TextBoxes, most of the Chinese...
3 Aug 2011 by Eric Lynch
A class to read Unicode character names and a tool to display/search them.
15 Jan 2011 by mdosi
Hi,Im working on a cross plateform development whereby Im sending a UTF-8 based message data (containing Chinese characters) from Windows to Linux.Now on the Linux side (using C++), I need to compare each line to find the Chinese string Im looking for and do the processing based on if I...
15 Jan 2011 by Espen Harlinn
This is a great project:ICU - International Components for Unicode[^], it will do the job on windows and linux.RegardsEspen Harlinn
2 Jul 2019 by Member 14518396
Hi guys I am having an issue where my contact form returns results in a different text format and I was wondering if there is perhaps anything wrong with my header in my contact form php. I get results such as: цветник на могилу цветник на могилу (Example email...
20 Jun 2018 by Member 10518995
I want to convert from Unicode to its original format UTF8 I think and it could be arabic like below. The user types some unicode text and when he clicks on convert it'll be converted to the original format like below : string unicode ="\u0633\u0637\u0648\u0631 \u0639\u0628\u0631...
22 Jan 2014 by Member 10518995
Finally i get the solution if anyone need some referenceprivate string convert_from_unicode(string str,char c){ string rtstr = ""; for (int i=2;i
11 Jul 2015 by Ahmad Haghighi
You can use this function: System.Uri.UnescapeDataString(string) I test it for you:string unicode = "\u0633\u0637\u0648\u0631 \u0639\u0628\u0631 \u0627\u0644\u0623\u064a\u0627\u0645 1"; string str = System.Uri.UnescapeDataString(unicode);result (str content) is:سطور...
20 Jun 2018 by Amir No-Family
Simply use: var output = System.Net.WebUtility.HtmlDecode(text);
11 Jan 2018 by gokings
SEEKING ADVICE REGARDING CONVERSION TO UNICODEWHY I AM ADOPTING UNICODE SO LATE[Feel free to skip to "The Situation", below, but if you do, please don't flame me for "waiting so long".]I'm a former professional software engineer and programmer.I was "away" from programming for...
11 Jan 2018 by Michael Haephrati
Here are most of the stages you need to take when converting an old project (defined as Use Multi-Byte Character Set or Not Set in Project -> Properties -> General -> Character Set. First you set this attribute to Unicode. 1. You will then have to change any hardcoded string to from...
16 Mar 2012 by Richard MacCutchan
Suggestion 1: Do not use big and bold letters within your questions as it is annoying and means that most people will ignore your question.Suggestion 2: Try a Google search first; there are lots of samples about converting Word to PDF and vice versa.Question: What do you mean by "support...
15 Dec 2017 by Ахих Тиманов
I have text "Привет" and i want convert it to Unicode var str = "Привет"; Encoding unicode = Encoding.Unicode; byte[] unicodeBytes = unicode.GetBytes(str); var rez = Encoding.UTF8.GetString(unicodeBytes).ToString(); In VS debugger i see this result https://i.snag.gy/yRP9pJ.jpg But in...
16 Dec 2017 by JustWatchLittle
c# strings are Unicode strings. It represents text as a sequence of UTF-16 code units. Read e.g. this: String Class (System)[^] [Edit] Not a short read, but to understand unicode, you most probably Need to go through several articles liek this: Unicode and You – BetterExplained[^] [Edit1]...
23 May 2011 by vipin choudhary`1
How i can convert Unicode string to XTG Format? can someone help me...its urgent for me.........Thanks in advance
4 Dec 2015 by Kobayashi Porcelain
I have a university assignment i need some help with. Don't give me the solution; hints or small portions of code would be appreciated.So, my university project is all about unicode. To be exact, I have to write code that takes character input in utf-16 format, converts it to utf-8 and...
4 Dec 2015 by Sergey Alexandrovich Kryukov
First, you did not show how your objects named char… are declared. You need to do all the calculations on 32-bit unsigned integer; in other cases, the size would be not enough to represent a code point beyond BMP.I did not check up UTF16 part, but at least one part is missing: there...
20 Jun 2013 by g77777
Hello good people, As the title says - I have a Non-English string I got from the web (by URLDownloadToFile())and I am trying to convert it to a readable, MySQL friendly, Unicode. This is the code I found in the MSDN but somehow it fails to do the work for me (strLine is the input string)....
20 Jun 2013 by Marc A. Brown
Take a look at this[^]. The guy was originally doing pretty much what you are trying with poor results but his answer seems to have solved his problem. Now, his code is in C#, but you should be able to convert it easily enough.Here's the code from the post:private byte[]...
20 Jun 2013 by TnTinMn
You have a downloaded text file in UTF-8 format. You must you have read the file to get that string. So why not set the encoding when you read it and let reader do the conversion?' set monospaced fontTextBox1.Font = New System.Drawing.Font("DejaVu Sans Mono", 10, _ ...
15 May 2011 by Doc Lobster
String conversion using the C++ Standard Library only
7 Jan 2011 by Rajesh Katalkar
I want to know how to copy content from wchar * to cstring safely.wchar *buff=(wchar*)malloc(500);cstring cbuff;How do I copy contents of buff into cbuff so that I can destroy buff?
7 Jan 2011 by Espen Harlinn
cstring cbuff;if(buff && (buff[0] != 0 )){ cbuff = cstring(buff);}RegardsEspen Harlinn
7 Jan 2011 by #realJSOP
Did you try this:cbuff = (LPCWSTR)buff;
7 Jan 2011 by Rajesh Katalkar
actually i m allocating memory with heapallocthe program crashes access violationbut works if used malloc and free Espen Harlinn and john i tried in both ways ..works if used malloc and crashes if used heapalloc WCHAR *buff=(WCHAR*)HeapAlloc(GetProcessHeap(),0,100);// WCHAR...
7 Jan 2011 by ShilpiP
Click here ->[^]
7 Jan 2011 by Aescleal
First question is... why are you using malloc or an OS function (HeapAlloc) when there's new/delete built into the language? If you use new or delete you can get rid of the cast and don't have to worry about sizing arrays.Second question is... does the code work if you use the explicit...
7 Jan 2011 by Rajesh Katalkar
hi ash i m using heapalloc because i can use heaprealloc to resize it instead of deleting and creating it again if i use new.i m compiling with _UNICODE regardsrajesh
5 Feb 2016 by Zhivko Kabaivanov
Hello.I am trying to paste some text form the clipboard to a specific field that is in some application. The application is on Windows 7, the Language for non-Unicode programs is set to that Cyrillic language. I have copied Cyrillic characters to the clipboard, something like "Петър"....
5 Feb 2016 by Sergey Alexandrovich Kryukov
This is what actually should happen to non-Unicode text. It's very likely that it's one of the obsolete Cyrillic-specific encodings. It could be Windows 1251 or KOI8-R:Windows-1251 — Wikipedia, the free encyclopedia[^],KOI8-R — Wikipedia, the free encyclopedia[^].Too bad, there are a lot...
5 Sep 2015 by Sultan Uz Zaman
How do I convert a unicode string that is in Bengali script to a plain English text?
5 Sep 2015 by Sultan Uz Zaman
I used a function to convert as follows:public string Convert2English(string bString) { int i = 0; string j,k=""; for (i = 0; i
8 Jan 2022 by Michael Haephrati
A Static Library which can be used for all kinds of database related needs
3 Sep 2013 by Stian Andre Olsen
EncodeText is a small program that can decode and encode text files using any of the codecs supported by Qt
1 Oct 2015 by hairy_hats
I've got an MFC project which is 20 years old and is still in daily use. While updating it to VS2015 I started getting warnings that MBCS is now deprecated and will be removed at some unspecified future date, so clearly Unicode Is The Future™.We've got thousands of saved files...
1 Oct 2015 by Richard MacCutchan
See http://blogs.msdn.com/b/vcblog/archive/2013/07/08/mfc-support-for-mbcs-deprecated-in-visual-studio-2013.aspx[^].
8 Sep 2013 by iDebD
I want to create a Library (Windows) with some API that can be easily loaded by any program and will help creating log files. I want my Library to be Supported both by Unicode and MBCS.Ex: Any unicode project can load this and use and send a unicode string to log it. Similarly any MBCS project...
8 Sep 2013 by Sergey Alexandrovich Kryukov
MBCS is not any specific encoding. In particular, Unicode UTF-8 and UTF-16 are also classified as MBCS: http://en.wikipedia.org/wiki/Multi-byte_character_set[^].In this respect, the question makes no sense, as you did not specify what non-Unicode MBCS encoding do you need and why. But let's...
17 Jan 2011 by Andrew Brock
C++ Supports unicode just fine, there are usually 3 options (4 in this case) options for printing itwprintf(L"€"); //The source file would need to be saved in a unicode format for this to work if it was a true unicode character (which it isn't)printf("\u20AC"); //\u = unicode, 20AC is the...
17 Jan 2011 by Ravi Sant
By default C+ supports ASCII characters and not unicode.Thus, according to me, it wont be possible to print € on screen.
27 Mar 2012 by subhendu_m
how can i display an unicode character in any editor when any key is pressed. basically it should display different characters for different key presses.
28 Mar 2012 by Sergey Alexandrovich Kryukov
How? The answer is: easily. Because these days most systems support Unicode.Further detail depend on such boring things as platform, language, used libraries, etc. It does not look like you care too much about that. :-)[EDIT: in response to a follow-up question]With C++, you need to...
21 Jan 2011 by Michael Groeger
21 Jan 2011 by Espen Harlinn
Sound like the font doesn't not include the required characters. Not all fonts support all unicode code points.RegardsEspen Harlinn
13 Nov 2012 by Nazim Iqbal
can done in VB.NETRichTextBox1.Text = (System.Text.RegularExpressions.Regex.Replace(str, "(\d{3,}?);", New System.Text.RegularExpressions.MatchEvaluator(AddressOf ConvertCode)))Just Convert this in C or C# by this site Convert Code SiteEnjoy
25 Aug 2010 by sindhusagar
Why does DLL not work in UNIX environment?
25 Aug 2010 by #realJSOP
Because a DLL isn't a unix format. I think you want to build a .SO file, and for that, you need a unix compiler.
25 Aug 2010 by CPallini
Windows and UNIX (and Linux) implement dynamic linking in different ways. See Wikipedia on dynamic linking[^] for info about. :)
10 Dec 2019 by auto9817
There is a great article about unicode manuplation in csharp. http://csharphelper.com/blog/2014/09/explore-unicode-characters-c/[^] Also the above link provides binary executable which you can print available unicode characters in the font "Times New Roman". However, when I try to draw this...
7 Dec 2019 by Richard MacCutchan
The square symbols are merely substitutes for Unicode characters that have no equivalent in the selected font and character set. This is quite common when printing non-latin alphabets.
10 Dec 2019 by User 11060979
The problem is, that Graphics.DrawString will not find the Glyph in "Times New Roman" an for "Times New Roman" no "fallback" is defined. One thing you can do is to add a "fallback font" for "Times New Roman" in the registry, btw from my point of view not a nice solution. For this, add another...
12 Jan 2018 by jessiefun
There is some problem while I want to export data to csv file: public void ExportLoalDataToCSV(DataTable dt, string fileName) { FileStream fs = new FileStream(fileName, FileMode.Create); StreamWriter sw = new StreamWriter(fs, Encoding.Unicode); ...
18 Nov 2010 by ARopo
Either come up with an escape sequence for comma e.g. &comma& then replace this with , after the split.or put each field in '' quotes and parse the string to ignore commas in between quotesor use a more unlikely character to separate your fields e.g. ^ instead of comma
18 Nov 2010 by JOAT-MON
You could try wrapping your strings in quotations:IEnumerable query = ( from row in dt.AsEnumerable() select row.Field("ID") + ", \"" + row.Field("Text") + "\"").Distinct();Also, since you are including the comma...
12 Jan 2018 by Michael Haephrati
The solution I have found to similar problems was to insert a BOM character to the .CSV file to indicate its encoding. CSV and BOM character - CSV[^] If you even inserted a UNICODE character to a Notepad file, and tried to save it, you would have seen a warning that the contents of the file will...
21 Mar 2015 by Amit Singh Baghel
A useful tip to export a Div to PDF (with Unicode support) with the help of NReco-PDF Generator for .NET (C#), JQuery and Handler in ASP.NET
3 Dec 2013 by StoyanovZ
Hi! I'm reworking on an old project(not started by me). I'm replacing the old dialog with a frame, so that I can put a ribbon instead of the menubar(that's the task). So... The original project doesn't work with Unicode, but in the frame's OnCreate method I need widechar strings for this...
3 Dec 2013 by KarstenK
i do that this way:CStringW strTitlePane2;bNameValid = strTitlePane1.LoadStringW(IDS_STATUS_PANE1)look out for the two "W" in the code :-Oor is the problem an invalid strind id of IDS_STATUS_PANE1 ???
3 Dec 2013 by theafien
[See this post]You can have problem with enconding charset.
3 Dec 2013 by Philippe Mori
I would suggest that you convert the part that does not works presently to works in Unicode.We are almost in 2014 so you are more than 10 years late to convert your application to Unicode. In 2000's, it was already possible to write Unicode program on Win 9x using Microsoft Layer for Unicode...
4 Dec 2013 by StoyanovZ
I simply had forgotten to describe the needed items in the .rc file :D