Questions tagged [multibyte-characters]
37 questions
22
votes
3 answers
Append part of Java byte array to StringBuilder
How do I append a portion of byte array to a StringBuilder object under Java? I have a segment of a function that reads from an InputStream into a byte array. I then want to append whatever I read into a StringBuilder object:
byte[] buffer = new…

bob
- 1,941
- 6
- 26
- 36
7
votes
1 answer
Printing fixed width strings that contain multi-byte characters
I have some strings that are stored in multi-byte UTF8 format, and I'd like to print them to the console in a fixed-width space. I am doing this by:
wprintf(L"////////////// BLOCK 1 /////////////// ////////////// BLOCK 2 /////////////// …

Jaska
- 187
- 1
- 6
7
votes
2 answers
UTF-8 text in MFC application that uses Multibyte character set
I am working on an application which receives text encoded in UTF-8 and needs to display it on some MFC control. The application is build using MultiByte character set (MBCS) and let's assume this cannot change.
I was hoping that if I convert the…

opetroch
- 3,929
- 2
- 22
- 24
4
votes
2 answers
Convert a String into an Array of Characters - multi-byte
Assuming that in 2019 every solution which is not UNICODE-safe is wrong. What is the best way to convert a string to array of UNICODE characters in PHP?
Obviously this means that accessing the bytes with the brace syntax is wrong, as well as using…

Dharman
- 30,962
- 25
- 85
- 135
3
votes
1 answer
How to find unknown character in mysql or in array
First I created database with utf8mb4_general_ci collation and created table with same collation. Then I import csv file with
load data local infile '/mnt/c/Users/justi/Desktop/enml/enml.csv'
into table dict
CHARACTER SET utf8mb4
fields…

Khtty
- 55
- 8
3
votes
1 answer
Is sizeof('ab') equal to sizeof(int) in C++?
Considering I have the following program that determines the size of multibyte characters.
#include
int main()
{
std::cout<<"size of multibyte characters : "<

msc
- 33,420
- 29
- 119
- 214
2
votes
1 answer
How to count the number of multibyte characters?
I'd like to get 5 instead of 10 for the following program. Does anybody know how to fix the code to count the number of multibyte characters? Thanks.
/* vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8: */
#include…

user1424739
- 11,937
- 17
- 63
- 152
2
votes
2 answers
How to sorting strings in unicode using a predefined alphabet?
I have a mysql table with words in unicode using signs like ḥ, ḫ š, etc.
The columns in the table are defined as utf8mb4_general_ci and recognize the above signs.
In the header of the webpage I put

Preys
- 103
- 7
2
votes
3 answers
MySQL 5.7 miss matching against two-Chinese-character words
Table tb:
title keywords
企业贷款,该如何看懂银行流水 出口退税,贷款,现金流量表,利润表
最高人民法院关于审理民间 企业贷款,合同法,贷款
中国宏观经济数据点评 企业贷款,贷款
ngram_token_size=2
FULLTEXT INDEX `keywords_title`(`keywords`, `title`)
Now I match keywords and title…

AarioAi
- 563
- 1
- 5
- 18
1
vote
4 answers
Rails truncate UTF-8 strings containing é (for example)
I am working on a rails 3.1 app with ruby 1.9.3 and mongoid as my ORM. I am facing an annoying issue. I would like to truncate the content of a post like this:
<%= raw truncate(strip_tags(post.content), :length => 200) %>
I am using raw and…

rpechayr
- 1,282
- 12
- 27
1
vote
1 answer
classic look of windows tab control in unicode MFC program?
I am working on an MFC dialog based program with CTabCtrl (VS2017, W10). Everything works as expected, apart from the way tabs look (convoluted story, don't ask).
I need them to look like on the right, but when I created a new project with a…

Borek
- 91
- 6
1
vote
3 answers
Get values which contain only whitelisted characters from a comma-delimited string
I have an array (converted from a string) that contains words with non-standard letters (letters not used in English, like ć, ä, ü). I don't want to replace those characters, I want to get rid of the whole words that have them.
from [Adam-Smith,…

Astw41
- 394
- 3
- 12
1
vote
1 answer
Convert const char* to UTF16 from C on macOS and Windows?
My attempts seem hacky and overly convoluted. Is there a simple way to convert ASCII to UTF16 on Windows and macOS?
(note that the prUTF16Char I can't change )
Attempt (written via https://stackoverflow.com/a/54376330)
Prelude
#include…

Samuel Marks
- 1,611
- 1
- 20
- 25
1
vote
1 answer
Text replacements with splice do not work with smiles (or multibyte chars)
I have a problem with a complex replacement algorithm. In the end I was able to reduce the problem to this minimal code:
const input="test hello test world"
let start = 0
let output = [...input]
const replacements = []
for (let end = 0; end <=…

rekire
- 47,260
- 30
- 167
- 264
1
vote
2 answers
How to download Rmarkdown report with multibyte character graph from shinyapps.io
Situation
Hi.
I'm trying to download the .pptx Rmarkdown report from shinyapps.io.
The problem is, I want to download a graph with a multibyte character. (Japanese)
Since shinyapps.io does not provide Japanese font, I use the showtext package to…

ironwest
- 187
- 2
- 9