Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [unicode]

Unicode is intended to be a universal character set for describing all the characters required for written text incorporating all writing systems, technical symbols and punctuation.

4
votes
2answers
71 views

Replace unicode character in the string

A function which replaces an unicode character in a string: ...
13
votes
1answer
1k views

Pretty printing of the numpy ndarrays

Following this idea for pretty printing of numpy ndarrays, I have developed a very primitive prototype: ...
7
votes
1answer
468 views

Subclassed Python Counter for a more visually user-friendly __str__() method, for anagrams

I wrote a Counter subclass suitable for anagrams, with a more visually user-friendly __str__() method using alphabetic ordering ...
4
votes
1answer
1k views

Convert to UTF-8 all files in a directory

1. Summary I can't find, how I can to refactor multiple with open for one file. 2. Expected behavior of program Program detect encoding for each file in the ...
3
votes
0answers
56 views

Removing text inside brackets [closed]

The following function removes text inside parenthesis, also checks for balanced brackets. Example: RemoveTextInsideParenthesis('Yahoo (Inc)') will return ...
5
votes
4answers
726 views

Convert UTF8 string to UTF32 string in C

I'm doing some recreational programming in C (after spending some time in C++, but professionally using only PHP/JavaScript). I wrote a UTF8 to UTF32 converter and just wanted to know if I made some ...
3
votes
0answers
261 views

Reverse string in Kotlin

In the question of how to reverse a string in Java, a comment mentioned that combining Unicode code points need to be taken into account. The below code works as intended for all test cases I tried. ...
3
votes
1answer
169 views

Game of Life improvement

I have finished my code for Conway's Game of Life. I am looking for any advice on how to improve it. I am a C++ beginner, so I used only basic libraries. I am accepting all suggestions. ...
3
votes
1answer
49 views

Preliminary draft of a data structure for a goodies tracker

My girlfriend and I are making a goodies tracker to enable us to keep better track of our stamp/gift cards. Right now we've got a super simple Object with some fields of what a stamp card has, and no ...
2
votes
1answer
531 views

Python script to scrape titles of public Youtube playlist

Just started in Python; wrote a script to get the names of all the titles in a public Youtube playlist given as input, but it got messier than it might have to be. I looked around online and found ...
5
votes
1answer
329 views

Normalize a GSM short message text

I am working to improve this script, which should prepare a text to be sent as a GSM short message using only the GSM 7-bit character coding with Basic Character Set Extension. ...
5
votes
0answers
71 views

Convert a mix of latin 1 and UTF-8 to proper UTF-8

The following program takes an arbitrary byte sequence as input and outputs well-formed UTF-8. All UTF-8 sequences from the input are copied unmodified. All other bytes are assumed to be encoded in ...
3
votes
2answers
59 views

Password string generation

I'm trying to create passwords using the following snippet to match a custom password policy. I've added three gtr statements, at the end of the string, to ...
2
votes
3answers
115 views

Filter out strings that are short or that are outside the alphabet of a language

I wrote this function to remove from the array those words that are less than n values. More precisely, I updated my old function and added some functionality. Since I am a beginner in this ...
0
votes
1answer
65 views

Termios line editor for APL - part 2

This is the completely re-worked version of the APL line editor using termios raw mode. (Earlier version) All switch constructs have been replaced with tables of ...
2
votes
1answer
107 views

Filtering user input to not contain a specific character

I need to filter an input from a user to never have the have the Pilcrow Sign (¶) character. The following methods filters the input from the user ...
1
vote
1answer
57 views

Javascript browser charset rendering detection

I am attempting to polyfill the broken character encoding system in javascript. For example, characters such as 😒, have a length of 2 and are treated as 2 separate ...
3
votes
1answer
91 views

Unicode Conversions

This is the implementation I've been using to convert between unicode strings for a while. I basically pieced it together from information off the internet, including finding a work around for the bug ...
1
vote
0answers
52 views

Unicode-friendly password generation

The following algorithm is meant to generate a password from a given set of characters, and a length. Is it biased or predictable in any way? And are graphemes the appropriate Unicode thing to use ...
1
vote
0answers
91 views

Generating ANTLR fragments for unicode identifier rules

The Unicode Consortium has actually defined a specification for the provision of a parsing and/or lexing engine for identifiers, such as programming language variables or domain names. (Unicode® ...
11
votes
1answer
160 views

VS 2015 std::char_traits<char16_t> operations

At my workplace, we changed string type (which holds internationalized characters) for from std::wstring to std::u16string after ...
2
votes
1answer
285 views

Simple gas station calculator for Windows

After reading some beginner textbooks on C++ programming, I decided to write a trivial unit conversion program. Since I am working on Windows, the console windows still use codepage 850 by default, ...
0
votes
1answer
50 views

Interchange all occurrences of a character and its predecessor

Given a string like "abcdbcfbc" , I want all the occurrences of 'b' to be interchanged with their previous character. The output should be: ...
3
votes
1answer
253 views

C# Encode Unicode Codepoints to UTF8 Manually

I want to encode unicode codepoints to utf8 manually. I wrote the following C# code. I testet it with some cases I know but I would like to know if its correct for all inputs. I know that Unicode ...
4
votes
1answer
3k views

Converting HEX values to Unicode characters

I have a small bot for social network, which accepts message "unicode XXXX XXXX XXXX ...", where XXXX - HEX values which I ...
4
votes
2answers
455 views

Extracting the first letter of a string

I'm extracting the first letter (not symbol) of a string using Unicode characters, with French words/sentences in mind. I have implemented it like this: ...
1
vote
0answers
397 views

Alternative session token implementation in flask

Here is my implementation of an alternative session token. The idea is to reset session_token every time get_id is called, so (I ...
2
votes
1answer
236 views

Sort the characters in a UnicodeString

The task: sort the characters in a string, as provided by the ICU UnicodeString. This is because I want to be able to find anagrams using the suggestion from "...
4
votes
1answer
83 views

Convert accented character to user name

I am using the below function for converting the accented character to a standard ASCII user name. ...
7
votes
3answers
268 views

Unicode Chess PvP with Move Validation

Main Purpose This script allows two players to play chess on a virtual chessboard printed on the screen by making use of the Unicode chess characters. Visual appearence ...
3
votes
0answers
137 views

Reduce encoded length of UTF-8 encoded Ruby string in C extension

I'm writing a Ruby extension in C. It's a string processing module working on UTF-8 encoded strings only. One method, full_width_to_ascii!, converts full width ...
3
votes
2answers
83 views

Check that files don't contain Unicode

I use this code to check that all files in a directory are free from Unicode and non-printable characters. Can I improve the structure of the code? ...
5
votes
1answer
703 views

Alternate letters to UpperCase

As an exercise I repeated this Java question, but in Go: Convert string to mixed case The objective is for every second letter to be converted to uppercase. Go string processing is relatively new to ...
3
votes
1answer
2k views

Get argument as unicode string from argparse in Python 2 and 3

Code from my last project, that has to work on Python 2.7 and Python 3. I want to get a path as a unicode string from argparse: ...
1
vote
2answers
260 views

Anchor Text String Transformation in Swift

I need to convert a string using these rules: Downcase the string Replace spaces, a blacklist of "invalid" chars, and non-ascii letters (like é) with - Replace ...
10
votes
1answer
389 views

Highlight specific words in a sentence with diacritrics

I am searching for some improvements, particularly in the regex, in the way I highlight specific words in a string. I have keywords into my database stored without any diacritrics The user comes with ...
5
votes
1answer
179 views

Termios/Xterm line editor for APL interpreter

As an interesting sub-part of an interpreter -- just the Read part of the REPL -- I present my raw-mode line-oriented editor that I intend to use for my APL interpreter. (The Eval part has been posted ...
3
votes
1answer
1k views

Converting Hindi Devanagari proprietary font to Unicode font

This working macro converts Hindi Devanagari proprietary font to Unicode font. It reads the conversion table from a tab delimited file, and converts one by one by finding all matches and then does ...
6
votes
2answers
125 views

Unicode-capable symbol table (N-way search tree with hash buckets)

As in my previous question, this module is coupled with its own testing framework. As a symbol-table for a Unicode-capable programming language interpreter, I decided to combine the 3 types of ...
4
votes
1answer
904 views

Dealing with messy JSON API and UTF-8 encoding problems

I am using an API that returns a JSON object that has "encoded_polyline" fields that tend to result in errors like this one: UnicodeEncodeError: 'utf-8' codec ...
7
votes
1answer
6k views

Removing accents from certain characters

I have a method that I am using to remove accents from certain characters. The problem is the massive slew of characters I am expected to work with. I have to, basically, remove accents from all Latin ...
7
votes
1answer
157 views

Korean Romanization to Hangeul library

After a little work, I've finally ironed this out... Though could I get someone to go over this and see if there is a better way to present this library within the code, before I publish it? Premise: ...
3
votes
1answer
110 views
4
votes
3answers
679 views

Listing all the chars in a given UnicodeBlock

I want to visually inspect all the characters that Java thinks are in any given UnicodeBlock. The following method, as far as I can tell, does the task. But, it sure feels like awful design. ...
8
votes
1answer
2k views

Serialization: Escape Input String

In Json strings characters can be escaped with \\. Here is an iterator that can read such strings and convert the escaped characters to UTF-8 ...
4
votes
1answer
73 views

Data-checking class supporting letters

I'm starting to learn OOP with PHP, and all I've learned so far is just by searching and reading. So I have this need to check input data for certain things like min of chars, max of chars, spaced or ...
10
votes
3answers
679 views

Mutable String Class

Here is a String class that I've made for fun in my spare time, for myself. I have a few concerns about it, and am considering going immutable or a mix of the two ...
8
votes
1answer
123 views

Copy directories while changing Unicode filenames to ASCII

I created a short Perl 6 script copyfnameascii.pl to copy a file hierarchy I have, applying an URL Decoding to the names of folders and removing non-ASCII ...
3
votes
2answers
121 views

Create nice url with diactrics removal

Please review my class. It uses iconv() (it's probably not the best solution however I haven't found any better alternative to change unknown characters). ...
11
votes
3answers
3k views

Customised Java UTF-16

I have implemented customized encoding mechanism for javaUTF16. Does this implementation support all the characters? ...