Questions tagged [mbcs]

MBCS is an abbreviation for "Multi-Byte Character Set" i.e. the representation of text using more than one byte per character.

MBCS is an abbreviation for "Multi-Byte Character Set" i.e. the representation of text using more than one byte per character. This is in contrast to "single-byte" encodings (such as ASCII or Latin-1) where each byte represents a single character.

For more information, please refer to this question: What is a multibyte character set?.

57 questions
69
votes
4 answers

Difference between MBCS and UTF-8 on Windows

I am reading about the charater set and encodings on Windows. I noticed that there are two compiler flags in Visual Studio compiler (for C++) called MBCS and UNICODE. What is the difference between them ? What I am not getting is how UTF-8 is…
Naveen
  • 74,600
  • 47
  • 176
  • 233
34
votes
6 answers

C++ project type: unicode vs multi-byte; pros and cons

I'm wondering what the Stack Overflow community thinks when it comes to creating a project (thinking primarily c++ here) with a unicode or a multi-byte character set. Are there pros to going Unicode straight from the start, implying all your…
Stefan Valianu
  • 1,370
  • 2
  • 13
  • 24
27
votes
5 answers

Convert first letter in string to uppercase

I have a string: "apple". How can I convert only the first character to uppercase and get a new string in the form of "Apple"? I can also have a string with multibyte characters. What if the first character of the string is a multibyte character ?
user1065276
  • 287
  • 1
  • 3
  • 6
24
votes
5 answers

How to know the preferred display width (in columns) of Unicode characters?

In different encodings of Unicode, for example UTF-16le or UTF-8, a character may occupy 2 or 3 bytes. Many Unicode applications doesn't take care of display width of Unicode chars just like they are all Latin letters. For example, in 80-column…
Lenik
  • 13,946
  • 17
  • 75
  • 103
21
votes
3 answers

MBCS Error building MFC C++ project with Visual Studio

I opened my existing MFC project using Visual Studio and when I build I get the following error message: Error 1 error MSB8031: Use of MBCS encoding in MFC projects require an additional library to be downloaded and installed. Please see…
Raman Sharma
  • 4,551
  • 4
  • 34
  • 63
19
votes
4 answers

Why isn't UTF-8 allowed as the "ANSI" code page?

The Windows _setmbcp function allows any valid code page... (except UTF-7 and UTF-8, which are not supported) OK, not supporting UTF-7 makes sense: Characters have non-unique representations and that introduces complexity and security risks. But…
dan04
  • 87,747
  • 23
  • 163
  • 198
5
votes
1 answer

Unable to convert the CStringW to CStringA

I am working on one project where I have stucked on one problem of converting CStringW to CStringA for multibyte string like Japanese Language. I am loading the string from string resources using LoadString() Method. I have tried following code but…
A B
  • 1,461
  • 2
  • 19
  • 54
5
votes
3 answers

Why printf can display non-ASCII characters when "C" locale is used?

Note: I'm asking an implementation defined behavior which is on Microsoft Visual C++ 2008(possibly the same on 2005+). OS: simplified Chinese installation of Win7. It surprises me when I'm performing non-ASCII I/O w/ printf. E.g. // This won't be…
Eric Z
  • 14,327
  • 7
  • 45
  • 69
5
votes
4 answers

Piecewise conversion of an MFC app to Unicode/MBCS

I have a large MFC application that I am extending to allow for multi-lingual input. At the moment I need to allow the user to enter Unicode data in edit boxes on a single dialog. Is there a way to do this without turning UNICODE or MBCS on for the…
Adam Tegen
  • 25,378
  • 33
  • 125
  • 153
4
votes
2 answers

How do text editors store data above 1 byte?

The basic question is, how does notepad (or other basic text editors) store data. I ran into this because I was trying to compare file size of different compression techniques, and realized something isn't quite right. To elaborate.. If I save a…
qoou
  • 155
  • 8
3
votes
0 answers

Unicode character causing error with bdist_wininst on python 3 but not python 2

I'm compiling windows installers for my python code. I mostly write language-related tools and include examples that require utf-8 strings in my documentation, including the README file. I'm slowly moving from Python 2 to Python 3 and recently…
Tim Mahrt
  • 103
  • 7
3
votes
1 answer

What is the character encoding of this file?

file extension is .PRO is decoded correctly by Notepad(!) is decoded correctly by Python via dbcs codec, but only on Windows most other programs (file, chardet, sublime-text, ...) incorrectly classify it as UTF-8 (and accordingly display Chinese…
xjcl
  • 12,848
  • 6
  • 67
  • 89
3
votes
5 answers

Error in manage.py runserver with Django on windows 8.1

I couldn't find this exitcode anywhere but hopefully one of you could help me or let me know if this is a bug in python/Django. Anyway, first here's the stacktrace: Traceback (most recent call last): File "C:\Sitezooi\SiteTest\manage.py", line…
Blanen
  • 682
  • 1
  • 8
  • 21
3
votes
3 answers

Reading and Writing registry keys. C++ MFC MBCS.

I would like to detect, and if possible read to a CString, a registry key starting with "HKEY_LOCAL_MACHINE\SOFTWARE\blah\SetupPath". I see the MSDN on RegOpenKeyEx function LONG WINAPI RegOpenKeyEx( _In_ HKEY hKey, _In_opt_ LPCTSTR…
user1311286
2
votes
1 answer

Filename formatting in Python under Windows

I have two distincts files called: '╠.txt' and '¦.txt' Such simple code: files = os.listdir('E:\pub\private\desktop\') for f in files: print f, repr(f), type (f) which would return ¦.txt '\xa6.txt' ¦.txt '\xa6.txt'
da_chinese
  • 23
  • 3
1
2 3 4