标签: urdu

如何在PHP中将文本转换为图像时加入Urdu字母表

我使用TIC将文本转换为图像.

我已经对此进行了大量搜索,但它似乎是Unicode问题(初始内侧和最终字母的unicodes)或者可能是内容类型,因为图像是在PNG中.

如果我没有呼应与图像转换content type text/htmlcharset=UTF-8我得到所需的输出加入乌尔都语字母.

require_once 'lib/tic.php';
$text="???? ??? ";

TIC::factory('C:\Windows\Fonts\Nastalique.ttf')
->setText($text)
->setPadding(10)
->setBgColor('ff0000')
->setFontColor(0xff, 0xff, 0x00)
->setFontSize(24)->create(true);
Run Code Online (Sandbox Code Playgroud)

出去吧

? ? ? ?  ? ? ? 
Run Code Online (Sandbox Code Playgroud)

php urdu

12
推荐指数
1
解决办法
502
查看次数

如何在r中正确连接bidi字符串?

我想将标记添加到从右到左书写的(乌尔都语)文本.我试图使用gsub用于此目的,但到目前为止我尝试的所有内容都不会产生所需的输出

text <- "?? ???? ??? ???? ?? ??? ??????? ??? ?? ??? ??"
pattern <- "??? ??"
replaceWith <- paste0("<somemark>", pattern, "</somemark>")
gsub(pattern, replaceWith, text)
Run Code Online (Sandbox Code Playgroud)

gsub返回以下内容

?? ???? ??? ???? ?? ??? ??????? <somemark>??? ??</somemark> ??? ??
Run Code Online (Sandbox Code Playgroud)

期望的输出.

在此输入图像描述

如何实现所需的输出?

注意:我甚至无法在帖子中正确排版所需的输出,我不得不依赖图像.

更新:虽然mysub下面的函数正确连接字符串(在控制台中),但我仍然面临闪亮应用程序中文本顺序错误的问题.

mysub <- function(text, pattern){
beforePattern <- substr(text, 1, regexpr(pattern, text)[1]-1)
afterPattern <- substr(text, regexpr(pattern,text)[1] + nchar(pattern), nchar(text))
result <- paste(afterPattern, replaceWith, beforePattern)
result
}
Run Code Online (Sandbox Code Playgroud)

r string-concatenation bidi shiny urdu

9
推荐指数
1
解决办法
314
查看次数

在乌尔都语中建立一个网站

我想在乌尔都语中建立一个网站,我用Google搜索并发现了一些unicode方法,现在我的问题是这些unicode是如何工作的,或者我如何从urdu语句中提取这些代码.

以下是用于在网站中显示urdu的代码段.

     <HTML>
 <HEAD>
 <META content="text/html; charset=utf-8" http-equiv=Content-Type>
 <TITLE>Ghazal</TITLE>
 <STYLE TYPE="text/css"><!--
 H1  {
   color: #007c78;
    font-family: "Urdu Nastaliq Unicode";
    font-size: 60px; }
 #urdu {
    font-family: "Urdu Nastaliq Unicode";
        font-size: 32px; }
 }
 --></STYLE>
  </HEAD>
 <BODY bgcolor="#ffffff">
 <bdo dir=rtl>
 <center>
 <table border=0>
 <tr><td align=right>
 <h1 align=right>
 &#65231;&#65143;&#65200;&#65142;&#65245;  <br>
 </h1>

 <span id=urdu>
  <P>
&#65207;&#65166;&#65249;&#65146; &#65231;&#65143;&#65250; &#65243;&#64431; 

&#65165;&#65203;&#65147;&#65268;&#65198; &#64424;&#65143;&#65268;&#64415; 

&#64424;&#65143;&#65250; &#65247;&#65262;&#64402;  <br>
&#65203;&#65145;&#65170;&#65186;&#65146; &#65255;&#65143;&#65262; 

&#65243;&#64431; &#65203;&#65143;&#65236;&#65147;&#65268;&#65198; 

&#64424;&#65143;&#65268;&#64415; &#64424;&#65143;&#65250; 

&#65247;&#65262;&#64402;  <br>
  <P>
&#65169;&#65145;&#65184;&#64427; &#64380;&#65145;&#64640; 

&#64424;&#65143;&#64431; &#64380;&#65143;&#65198;&#65165;&#65229; 

&#64404;&#65262; &#65193;&#65146;&#65245; &#64567;  <br>
&#64344;&#64429;&#65147;&#65198; &#65169;&#64429;&#65147;&#64509; 

&#65197;&#65261;&#65207;&#65143;&#65254; 

&#65215;&#65143;&#65252;&#65147;&#65268;&#65198; …
Run Code Online (Sandbox Code Playgroud)

html unicode urdu

5
推荐指数
1
解决办法
6737
查看次数

根据不存在的空间分割乌尔都语单词

I have a Urdu word "\xd9\x84\xd8\xa7\xd8\xb9\xd9\x84\xd9\x85" and more similar words. How can I split the word that I get "\xd9\x84\xd8\xa7" and "\xd8\xb9\xd9\x84\xd9\x85" separately in an array? I have tried converting the words to unicode characters, but I can,t detect the break between "\xd9\x84\xd8\xa7" and "\xd8\xb9\xd9\x84\xd9\x85".

\n\n

English words can be easily separated based on spaces, but I am stuck on separating Urdu words, where there are no spaces.

\n

c# regex urdu

5
推荐指数
1
解决办法
1416
查看次数

如何知道文字是阿拉伯语还是乌尔都语

我想知道文本是否包含乌尔都语或阿拉伯语的任何字母..使用这种条件会在出现特殊字符时产生错​​误的结果。什么是正确的方法。

   if (cap.replaceAll("\\s+", "").matches("[A-Za-z]+")
                    || cap.replaceAll("\\s+", "").matches("[A-Za-z0-9]+")) {
                Log.d("isUrdu", "false");
                caption.setTypeface(Typeface.DEFAULT);
                caption.setTextSize(16);

            } else {
                Log.d("isUrdu", "True");
             /*   if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR1) {*/
                    caption.setTypeface(typeface);
                    caption.setTextSize(20);

         /*       }*/
            }
Run Code Online (Sandbox Code Playgroud)

java regex android arabic urdu

5
推荐指数
1
解决办法
849
查看次数

如何在php中将变量(文本/字符串)转换为utf8mb4

嗨,我正在寻找 utf8mb4 的编码功能,

$var = = "???";

echo utf8mb4_encode($string);

output = نور // its $var output in UTFMB4
Run Code Online (Sandbox Code Playgroud)

输出应该是 "نور" 这个,它是 utfmb4 中 $var 的转换

php utf-8 utf8mb4 urdu

4
推荐指数
2
解决办法
2万
查看次数

标签 统计

urdu ×6

php ×2

regex ×2

android ×1

arabic ×1

bidi ×1

c# ×1

html ×1

java ×1

r ×1

shiny ×1

string-concatenation ×1

unicode ×1

utf-8 ×1

utf8mb4 ×1