character

Malformed Farsi characters on AWT

浪子不回头ぞ 提交于 2019-12-10 08:17:52
问题 When I started programming with the JDK6, I had no problem with text components , neither in AWT nor in Swing. But for labels or titles of AWT components I do have a problem. I can't display Farsi characters on AWTs components (in Swing I type them into the source code). Here's my sample code: import javax.swing.*; import java.awt.*; import java.io.*; import java.util.Properties; public class EmptyFarsiCharsOnAWT extends JFrame{ public EmptyFarsiCharsOnAWT() { super("مثال");

force eclipse to ignore character encoding attribute

故事扮演 提交于 2019-12-10 08:14:14
问题 I'm working with a web framework that uses a dynamic character encoding in its html templates, like this: <meta charset="${_response_encoding}"> The problem is when I try to edit this file in Eclipse, Eclipse thinks this is a literal encoding type, and thus refuses to open the file, saying: "Unsupported Character Encoding" Character encoding "${_response_encoding}" is not supported by this platform. Is there any way to tell Eclipse to stop trying to be "smart" (because it plainly isn't) and

REGEXP_REPLACE - remove commas from string ONLY if enclosed in ()'s

我的未来我决定 提交于 2019-12-10 03:31:57
问题 I find an example at oracle forum site : Input string : a, b, c (x, y, z), a, (xx, yy, zz), x, WITH t AS (SELECT 'a, b, c (x, y, z), a, (xx, yy, zz), x,' col1 FROM dual) SELECT t.col1 , REGEXP_REPLACE(t.col1, '(\(.*?\))|,', '\1') new_col FROM t Output : a b c (x, y, z) a (xx, yy, zz) x But i want to make opposite of that. Just remove this character , from inside () and remain outside. Output : a, b, c (x y z), a, (xx yy zz), x, 回答1: This will work for a constant length of arguments with in

Awk: Characters-frequency from one text file?

戏子无情 提交于 2019-12-09 23:44:08
问题 Given a multilangual .txt files such as: But where is Esope the holly Bastard But where is 생 지 옥 이 군 지 옥 이 지 옥 지 我 是 你 的 爸 爸 ! 爸 爸 ! ! ! 你 不 會 的 ! I counted space-separated words' word-frequency using this Awk function : $ awk '{a[$1]++}END{for(k in a)print a[k],k}' RS=" |\n" myfile.txt | sort Getting the elegant : 1 생 1 군 1 Bastard 1 Esope 1 holly 1 the 1 不 1 我 1 是 1 會 2 이 2 But 2 is 2 where 2 你 2 的 3 옥 4 지 4 爸 5 ! How to change it to count characters-frequency ? EDIT: For Characters

jQuery parseJSON

喜夏-厌秋 提交于 2019-12-09 23:07:26
问题 Receiving this error ("JSON.parse: unexpected character") when I try to parse a JSON validated string. It works perfectly when I remove the characters that need escaped (style="width:400px;"). What am I missing? Is there a unique way to escape characters before you use parseJSON? var $cookieString = '{"youTabItems": { "youTab-001": <p style=\"width:400px;\">Welcome to my test</p>, "youTab-002": "test02Value", "youTab-003": "test03Value" }}'; var $myCookieString = $.parseJSON($cookieString);

Sphinx search: charset table difficulties

自古美人都是妖i 提交于 2019-12-09 21:07:00
问题 I am loosing my mind on this for two days now... I would like to use slovenian letters in sphinx search, all english ones + č ž š (and just in case ć) I was looking all over the net to get the proper chars but I found squat... so I decided to make my own step by step... this is my index index classifieds { source = classifieds_src path = c:\Sphinx\data\classifieds docinfo = extern min_infix_len = 2 infix_fields = title,keywords,summary,text expand_keywords = 1 enable_star = 1 charset_type =

How to export pound symbol from a C# Web App to Excel correctly? (£ is produced instead of £)

怎甘沉沦 提交于 2019-12-09 19:31:10
问题 We're exporting some data from a website app into an Excel spreadsheet, however, when a GBP symbol is used, instead of outputting "£9.99" it produces "£9.99". Here's the code a colleague has written to produce the spreadsheet [tableOut is a StringBuilder that contains an HTML table]: string filename = "EngageReplies.xls"; Response.Clear(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader( "content-disposition", "attachment;filename=" + filename );

DOS Batch script to convert string 2 hex

▼魔方 西西 提交于 2019-12-09 17:58:44
问题 How can I convert sring to hex in DOS Batch script? For example, convert "abcd" to "61626364". Since, 'a' is 0x61... I tried to find a solution from web, a day, but could not find my answer. 回答1: @echo off setlocal EnableDelayedExpansion rem Store the string in chr.tmp file set /P "=%~1" < NUL > chr.tmp rem Create zero.tmp file with the same number of Ascii zero characters for %%a in (chr.tmp) do fsutil file createnew zero.tmp %%~Za > NUL rem Compare both files with FC /B and get the

How could I catch an “Unicode non-character”-warning?

倾然丶 夕夏残阳落幕 提交于 2019-12-09 17:53:32
问题 How could I catch the "Unicode non-character 0xffff is illegal for interchange"-warning? #!/usr/bin/env perl use warnings; use 5.012; use Try::Tiny; use warnings FATAL => qw(all); my $character; try { $character = "\x{ffff}"; } catch { die "---------- caught error ----------\n"; }; say "something"; Output: # Unicode non-character 0xffff is illegal for interchange at ./perl1.pl line 11. 回答1: A Perl 5.10.0 ⋯ 5.13.8 Bug I’m going to assume that you don’t actually want to “catch” this warning,

Convert string to single digits and sum

家住魔仙堡 提交于 2019-12-09 15:53:55
问题 I've tried for hours to find a solution to what I thought was an easy task but I failed. I have a string consisting of 3 different characters ('I','R' & 'O') with length from 1 to 6. E.g IRRROO RRORRR IIR RIRRO Each character represents a number I=1,R=2,O=3 I need to convert this string to a single number, multiply with position and sum the result. E.g IRRROO ---> (1*1)+(2*2)+(2*3)+(2*4)+(3*5)+(3*6) =52 IIR ---> (1*1)+(1*2)+(2*3) =9 Thanks in advance for your help. 回答1: factors have numeric