首页 \ 问答 \ Unicode和字体(Unicode and fonts)

Unicode和字体(Unicode and fonts)

这是我没有看到太多讨论。 我正在开发一种支持多种语言的软件,因此,我需要使用Unicode兼容字体,对吧? 我在哪里可以找到这样的字体,我怎么知道他们支持中文,韩文,日文,无论有什么?

很遗憾,你不能使用Internet上的漂亮字体,因为它们大多数只支持ASCII。


This is something that I don't see much discussed. I'm developing a software that will support multilingualism, thus, I would need to use Unicode compatible fonts, right? Where could I possibly find such fonts and how would I know for sure they support Chinese, Korean, Japanese, whatever there exist?

It's a shame you can't use beautiful fonts found in the Internet, because most of them support ASCII only.


原文:https://stackoverflow.com/questions/1653808
更新时间:2022-08-11 16:08

最满意答案

算法总是使用快速排序还是依赖于编译器实现?

它取决于实现。

您会建议使用此功能还是模板真的有益处?

C没有模板。 如果你需要C语言中的泛型排序功能,那么qsort是一个不错的选择。

如果您打算使用C ++,那么您应该使用std::sort ,它更容易正确使用并且提供类型安全性。

是否有任何我应该注意的事项以避免安全问题/段错误?

如果您不正确地使用该函数(例如,如果您传递不正确的参数或者您的比较函数中有错误),那么您的程序可能会崩溃(或者可能会执行不正确的操作)。 当然,这不是qsort特有的; 对于程序中使用的任何内容都是如此。


Is the algorithm used always a quicksort or is it compiler-implementation-dependent?

It is implementation dependent.

Would you recommend using this function or is there a real benefit to templates?

C does not have templates. If you need a generic sorting function in C, then qsort is a good choice.

If you are going to use C++, then you should use std::sort, which is much easier to use correctly and gives type safety.

Are there any things I should watch out for to avoid security problems/segfaults?

If you use the function improperly (for example, if you pass it incorrect parameters or if your comparison function has bugs in it), then your program might well crash (or might otherwise perform incorrectly). Of course, this isn't specific to qsort; this is true for anything used in a program.

相关问答

更多
  • 我认为分区是正确的。 7是枢轴。 原始数组被划分为长度为5的子数组,其中包含小于或等于7的元素和长度为2的子数组,包含大于或等于7的元素。 I think the partitioning is correct. 7 is the pivot. The original array is partitioned into a sub array of length 5 containing elements less than or equal to 7 and a sub array of length ...
  • 算法总是使用快速排序还是依赖于编译器实现? 它取决于实现。 您会建议使用此功能还是模板真的有益处? C没有模板。 如果你需要C语言中的泛型排序功能,那么qsort是一个不错的选择。 如果您打算使用C ++,那么您应该使用std::sort ,它更容易正确使用并且提供类型安全性。 是否有任何我应该注意的事项以避免安全问题/段错误? 如果您不正确地使用该函数(例如,如果您传递不正确的参数或者您的比较函数中有错误),那么您的程序可能会崩溃(或者可能会执行不正确的操作)。 当然,这不是qsort特有的; 对于程序中 ...
  • 标准C ++没有灵活的数组成员 (如C99所示)。 您不需要您的Array类,而是使用std::vector (如果数组长度是编译时间常量,则可能使用带有C ++ 11的std::array ) 如果要声明包含Items的Array类,请按照Joachim Pileborg注释中的提示,了解三个规则 (在C ++ 11中,它成为五个规则),因此声明: int *Items; 在你的课堂上,然后用它初始化 Items = new int[n]; 在它的构造函数[s]中,用它来销毁它 delete ...
  • 阅读您提供给@JohnBollinger的书链接之后。 我明白你的算法是如何工作的。 你的问题是你的支点移动,但你不改变v的值。 你的支点在索引lt char *ptr = base; int lt = lo, gt = hi; // lt is the pivot int i = lo + 1; // we don't compare pivot with itself while (i <= gt) { int c = cmp(ptr + lt * size, ptr + i * size); ...
  • 是否有可能只使用一个快速排序或者我应该尝试创建两个函数:一个将奇数索引排序,另一个是偶数索引? quick sort通常用于按升序或降序对元素进行排序,因此我认为仅对所需模式中的元素进行排序(它既不是升序也不是降序,甚至在答案数组中都没有保证特定模式)也没有用处。 )只使用quick sort 。 在我看来创建一个额外的自定义函数说required_sort()并根据需要排序元素以及qucksort()的帮助(在我的情况下,它按升序排序)将是最好的方法去 void required_sort(int arr ...
  • 正如评论中指出的那样,将L值传递给pickPiv非常缓慢,但是代码中存在更多问题。 您不需要将L传递给您所定义的lambda表达式,因为它们只能在a和b 。 您不应该使用lambda表达式进行递归,而应该传递现有的pickPiv 强烈考虑使用std::uniform_int_distribution来挑选你的随机支点。 void quickSort (vector &L, function pickPiv, int a, int b){ if (b = ...
  • 在分区函数的倒数第二行中,您应该具有: a[r] = tmp; 代替: a[r] = a[tmp]; 您正在用其他成员覆盖部分阵列,而不是完成交换的第三步。 In the second to last line of your partition function you should have: a[r] = tmp; instead of: a[r] = a[tmp]; You are overwriting parts of your array with other memb ...
  • p函数严重缩进; 谈到缩进,我倾向于认为在下一行中使用in的风格对于单行声明来说是过度的,所以我宁愿将它们放在单行声明的末尾。 更重要的是,没有必要将列表的元组作为参数,你将使用两个独立的(curried)参数在语法上更轻松。 您还可以使用标准库的List.partition函数。 The p function is badly indented; speaking of indentation, I tend to think the style of having a in on the next li ...
  • 这是我的尝试: fun swap(A,i,j) = let val t = Array.sub(A,i) in Array.update(A,i,Array.sub(A,j)); Array.update(A,j,t) end fun firstAfter(A,i,f) = if f(Array.sub(A,i)) then i else firstAfter(A,i+1,f) fun lastBefore(A,j,f) ...
  • billz的评论告诉你到底出了什么问题,但让我试着用更简单的话来说: 你的Qsort一直在Qsort调用自己,这个循环永远不会停止,直到你的机器耗尽资源。 你忘了包含一切都完成时会触发的返回条件。 在排序例程的情况下,这通常是在单个元素上调用排序机制时:没有什么可以排序,所以我们也可以停止。 尝试在您的程序中包含此条件。 billz's comment tells you exactly what's wrong, but let me try to put it into simpler words: Y ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)