utf-8

UTF-8 to ANSI Conversion using C#

烂漫一生 提交于 2020-08-27 05:45:11
问题 I'm a .NET developer and was asked to do an application that converts html files to ANSI in C#. ANSI is necessary because the converted files will run on a Visual Fox Pro application. The basic logic is ready the problem is with the conversion itself. I've tried this code: http://social.msdn.microsoft.com/Forums/pt-BR/026ddda3-9bd1-4502-b445-e2a1cc88345d/convert-file-from-utf8-to-ansi?forum=csharplanguage but when I checked it on editplus the file is still not converted to ANSI and even worst

How to convert UTF8 string to UTF16

旧时模样 提交于 2020-08-23 08:56:20
问题 I'm getting a UTF8 string by processing a request sent by a client application. But the string is really UTF16. What can I do to get it into my local string is a letter followed by \0 character? I need to convert that String into UTF16. Sample received string: S\0a\0m\0p\0l\0e (UTF8). What I want is : Sample (UTF16) FileItem item = (FileItem) iter.next(); String field = ""; String value = ""; if (item.isFormField()) { try{ value=item.getString(); System.out.println("====" + value); } 回答1: The

How to convert UTF8 string to UTF16

狂风中的少年 提交于 2020-08-23 08:55:38
问题 I'm getting a UTF8 string by processing a request sent by a client application. But the string is really UTF16. What can I do to get it into my local string is a letter followed by \0 character? I need to convert that String into UTF16. Sample received string: S\0a\0m\0p\0l\0e (UTF8). What I want is : Sample (UTF16) FileItem item = (FileItem) iter.next(); String field = ""; String value = ""; if (item.isFormField()) { try{ value=item.getString(); System.out.println("====" + value); } 回答1: The

How to use character code with ::before pseudo element

偶尔善良 提交于 2020-08-10 17:52:04
问题 I have html with <meta charset="UTF-8"> and want add black right-pointing pointer to span::before but it`s not working. If I simply put &#x25ba to html I would see pointer. But with content I see different problems. I try content: '►'; - it`s show strange symbol. Also does not work '&#x25ba' , '\&#x25ba' , '\x25ba' , '\#x25ba' , '\9658' and other combinations. I can use background-image or something like that, but I don`t want do this. Maybe you know what I`m doing wrong? Thanks for help! 回答1

wchar_t* with UTF8 chars in MSVC

梦想的初衷 提交于 2020-08-07 18:27:15
问题 I am trying to format wchar_t* with UTF-8 characters using vsnprintf and then printing the buffer using printf . Given the following code: /* This code is modified version of KB sample: https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/rtref/vsnprintf.htm The usage of `setlocale` is required by my real-world scenario, but can be modified if that fixes the issue. */ #include <wchar.h> #include <stdarg.h> #include <stdio.h> #include <locale.h> #ifdef MSVC #include <windows.h> #endif

wchar_t* with UTF8 chars in MSVC

…衆ロ難τιáo~ 提交于 2020-08-07 18:26:29
问题 I am trying to format wchar_t* with UTF-8 characters using vsnprintf and then printing the buffer using printf . Given the following code: /* This code is modified version of KB sample: https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/rtref/vsnprintf.htm The usage of `setlocale` is required by my real-world scenario, but can be modified if that fixes the issue. */ #include <wchar.h> #include <stdarg.h> #include <stdio.h> #include <locale.h> #ifdef MSVC #include <windows.h> #endif