utf-8

How do I configure a terminal to read UTF-8 characters?

安稳与你 提交于 2021-02-11 14:26:32
问题 I am working on a project which accepts user input via the command line. I am using up-to-date Windows 10 and (after much running around in circles...) I am aware that it is notoriously bad when it comes to handling UTF-8 characters. Consequently, I looked to VS Code and the integrated terminal (PowerShell) to perform input into the program. Sadly, the terminal seemed unable to accept accented UTF-8 characters such as "ë". I then did more research and configured the settings.json for VS Code

Making a UTF-8 call from VBA

落花浮王杯 提交于 2021-02-11 13:23:29
问题 I'm trying to make calls to openstreetmap (specifically to https://nominatim.openstreetmap.org/search?amenity=charging_station&format=json&q=Elly-Beinhorn-Ring+2,12529+Schönefeld ) and from any webbrowser it works fine. When calling via Excel VBA is complains that the string is not UTF-8. I haven't used fiddler yet but to me it is clear that srequest should be in UTF-8 format. I found another solution to convert the url to ascii but I'd prefer to have it in utf-8 here's some sample code which

String from NSInputStream is not valid utf8. How to convert to utf8 more 'lossy'

吃可爱长大的小学妹 提交于 2021-02-11 06:31:52
问题 I have an App that reads data from a server. Now and then, the data appears to be not valid UTF-8. If I convert from the byte array to an UTF8-String, the string appears nil. There must be some invalid not-UTF8 character in the byte array. Is there a way to 'lossy' convert the byte array to UTF8 and filter out only the invalid characters? Any ideas? My code looks like this: - (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent { switch (streamEvent){ case

Python 3.5 not handling unicode input from CLI argument

丶灬走出姿态 提交于 2021-02-11 05:53:37
问题 I have a simple script that I'm attempting to use automate some of the japanese translation I do for my job. import requests import sys import json base_url = 'https://www.googleapis.com/language/translate/v2?key=CANT_SHARE_THAT&source=ja&target=en&q=' print(sys.argv[1]) base_url += sys.argv[1] request = requests.get( base_url ) if request.status_code != 200: print("Error on request") print( json.loads(request.text)['data']['translations'][0]['translatedText']) When the first argument is a

write unicode data to mssql with python?

前提是你 提交于 2021-02-10 15:50:14
问题 I'm trying to write a table from a .csv file with Hebrew text in it to an sql server database. the table is valid and pandas reads the data correct (even displays the hebrew properly in pycharm), but when i try to write it to a table in the database i get question marks ( "???" ) where the Hebrew should be. this is what i've tried, using pandas and sqlalchemy: import pandas as pd from sqlalchemy import create_engine engine = create_engine('mssql+pymssql://server/test?charset=utf8') connection

Troubles with encoding, pattern matching and noisy texts in R

谁说胖子不能爱 提交于 2021-02-10 14:36:56
问题 We are experiencing problems with encoding, pattern matching using texts automatically downloaded from the web. We need some help to understand where the problem lies and how to fix it. Personally, I must confess that after having read so many posts on the topic, I am completely confused :-) Our texts sometimes include: 1) disturbing Unicode (I have read this already (Automatically escape unicode characters ), but I am not sure in which way it can help with regular expressions) 2) weird

What character encoding is this?

╄→гoц情女王★ 提交于 2021-02-10 13:24:53
问题 I'm interfacing with an Oracle DB, which has some messed up encoding (ASCII7 according to the db properties, but actually encodes Korean characters). When I get some of the Korean strings from the resultSet, and look at the bytes, it turns out that they correspond exactly to this file (I found by googling some of the byte sequences): http://211.115.85.9/files/raw3.txt Kinda spooky, as it seems to be the ONLY thing on the internet that has anything about this particular encoding... The file,

PHP Fatal error: Class 'Collator' not found despite PHP 5.3.24

北城以北 提交于 2021-02-10 12:55:12
问题 my output after code below is: " PHP Fatal error: Class 'Collator' not found ". I've read in php manual that for COLLATOR class , PHP version needs to be PHP 5 >= 5.3.0. My PHP version is 5.3.24. in my phpinfo() I searched 'coll' string but nothing is found. also please note that my site lang is Turkish and I am using UTF-8 So what is the reason for my fatal error output? Thanks. /* fetch values */ $etiket_bulutu = ''; while ($beyan->fetch()) { $etiket_bulutu .= $tags.', '; } $etiket_bulutu =

PHP Fatal error: Class 'Collator' not found despite PHP 5.3.24

删除回忆录丶 提交于 2021-02-10 12:52:32
问题 my output after code below is: " PHP Fatal error: Class 'Collator' not found ". I've read in php manual that for COLLATOR class , PHP version needs to be PHP 5 >= 5.3.0. My PHP version is 5.3.24. in my phpinfo() I searched 'coll' string but nothing is found. also please note that my site lang is Turkish and I am using UTF-8 So what is the reason for my fatal error output? Thanks. /* fetch values */ $etiket_bulutu = ''; while ($beyan->fetch()) { $etiket_bulutu .= $tags.', '; } $etiket_bulutu =

Convert html entities to UTF-8, but keep existing UTF-8

风流意气都作罢 提交于 2021-02-10 11:45:31
问题 I want to convert html entities to UTF-8, but mb_convert_encoding destroys already UTF-8 encoded characters. Whats the correct way? $text = "äöü ä ö ü ß"; var_dump(mb_convert_encoding($text, 'UTF-8', 'HTML-ENTITIES')); // string(24) "äöü ä ö ü ß" 回答1: mb_convert_encoding() isn't the correct function for what you're trying to achieve: you should really be using html_entity_decode() instead, because it will only convert the actual html entities to UTF-8, and won't affect the existing UTF-8